X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fcontent%2Fbrowser%2Floader%2Fresource_scheduler.h;h=2b8d7373b4f2c92f20ee194a182e4680a413cb25;hb=1afa4dd80ef85af7c90efaea6959db1d92330844;hp=a2a873e77562f7c4b792641338925e74a2f7dca4;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/content/browser/loader/resource_scheduler.h b/src/content/browser/loader/resource_scheduler.h index a2a873e..2b8d737 100644 --- a/src/content/browser/loader/resource_scheduler.h +++ b/src/content/browser/loader/resource_scheduler.h @@ -111,7 +111,10 @@ class CONTENT_EXPORT ResourceScheduler : public base::NonThreadSafe { // Signals from the UI thread, posted as tasks on the IO thread: // Called when a renderer is created. - void OnClientCreated(int child_id, int route_id, bool is_visible); + void OnClientCreated(int child_id, + int route_id, + bool is_visible, + bool is_audible); // Called when a renderer is destroyed. void OnClientDeleted(int child_id, int route_id); @@ -122,6 +125,9 @@ class CONTENT_EXPORT ResourceScheduler : public base::NonThreadSafe { // Called when a Client is shown or hidden. void OnVisibilityChanged(int child_id, int route_id, bool is_visible); + // Called when a Client starts or stops playing audio. + void OnAudibilityChanged(int child_id, int route_id, bool is_audible); + // Signals from IPC messages directly from the renderers: // Called when a client navigates to a new main document. @@ -142,12 +148,18 @@ class CONTENT_EXPORT ResourceScheduler : public base::NonThreadSafe { // Called to check if all user observable tabs have completed loading. bool active_clients_loaded() const { return active_clients_loading_ == 0; } - // Called when a Client starts or stops playing audio. - void OnAudibilityChanged(int child_id, int route_id, bool is_audible); - bool IsClientVisibleForTesting(int child_id, int route_id); private: + enum ClientState { + // Observable client. + ACTIVE, + // Non-observable client. + BACKGROUND, + // No client found. + UNKNOWN, + }; + class RequestQueue; class ScheduledResourceRequest; struct RequestPriorityParams; @@ -185,6 +197,10 @@ class CONTENT_EXPORT ResourceScheduler : public base::NonThreadSafe { size_t CountCoalescedClients() const; + // Returns UNKNOWN if the corresponding client is not found, else returns + // whether the client is ACTIVE (user-observable) or BACKGROUND. + ClientState GetClientState(ClientId client_id) const; + // Update the queue position for |request|, possibly causing it to start // loading. //