From: Ben Hutchings Date: Wed, 21 Dec 2005 02:34:54 +0000 (+0000) Subject: Replaced multiple is-browser-busy tests with a member function. X-Git-Tag: 0.6~7 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=videolink.git;a=commitdiff_plain;h=72534f81da76c6c731c5d688d8485e6d9c9e2c9a Replaced multiple is-browser-busy tests with a member function. --- diff --git a/webdvd.cpp b/webdvd.cpp index 31ad122..26e4260 100644 --- a/webdvd.cpp +++ b/webdvd.cpp @@ -215,6 +215,10 @@ namespace dvd_contents::pgc_ref add_title(const std::string & uri); void load_next_page(); void on_net_state_change(const char * uri, gint flags, guint status); + bool browser_is_busy() const + { + return pending_window_update_ || pending_req_count_; + } bool process_page(); void save_screenshot(); void process_links(nsIPresShell * pres_shell, @@ -407,7 +411,7 @@ namespace pending_window_update_ = false; } - if (pending_req_count_ == 0 && !pending_window_update_) + if (!browser_is_busy()) { try { @@ -455,7 +459,7 @@ namespace // Might need to wait a while for things to load or more // likely for a re-layout. - if (pending_req_count_ > 0) + if (browser_is_busy()) return true; } @@ -714,7 +718,7 @@ namespace // We may have to exit and wait for image loading // to complete, at which point we will be called // again. - if (pending_req_count_ > 0) + if (browser_is_busy()) { state->link_changing = true; page_state_ = state;