]> git.decadent.org.uk Git - videolink.git/blobdiff - webdvd.cpp
Replaced multiple is-browser-busy tests with a member function.
[videolink.git] / webdvd.cpp
index 31ad122776a154586a14ea9baf4e7642331dcd5a..26e426062bd6aaa1bca1924cf443dc5f7a88a4ad 100644 (file)
@@ -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;