| Index: chrome/browser/extensions/user_script_listener.h
|
| diff --git a/chrome/browser/extensions/user_script_listener.h b/chrome/browser/extensions/user_script_listener.h
|
| index 105af4d279059b82a4a7d3e1aff76fd38a1a996f..f24bd05ccccd5ec4957325e7d85e2a7f0b885682 100644
|
| --- a/chrome/browser/extensions/user_script_listener.h
|
| +++ b/chrome/browser/extensions/user_script_listener.h
|
| @@ -8,12 +8,13 @@
|
| #include <list>
|
|
|
| #include "base/ref_counted.h"
|
| -#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
|
| +#include "chrome/browser/renderer_host/resource_queue.h"
|
| #include "chrome/common/extensions/url_pattern.h"
|
| #include "chrome/common/notification_registrar.h"
|
|
|
| class Extension;
|
| class URLRequest;
|
| +struct GlobalRequestID;
|
|
|
| // This class handles delaying of resource loads that depend on unloaded user
|
| // scripts. For each request that comes in, we check if it depends on a user
|
| @@ -24,16 +25,17 @@ class URLRequest;
|
| // updates to loaded extensions.
|
| class UserScriptListener
|
| : public base::RefCountedThreadSafe<UserScriptListener>,
|
| + public ResourceQueueDelegate,
|
| public NotificationObserver {
|
| public:
|
| - explicit UserScriptListener(ResourceDispatcherHost* rdh);
|
| + explicit UserScriptListener(ResourceQueue* resource_queue);
|
|
|
| - void OnResourceDispatcherHostGone() { resource_dispatcher_host_ = NULL; }
|
| -
|
| - // Returns true if we're ready to service the request. Otherwise, if the
|
| - // request URL depends on any user scripts that haven't been loaded yet, we
|
| - // will delay the request until we're ready.
|
| - bool ShouldStartRequest(URLRequest* request);
|
| + // ResourceQueueDelegate:
|
| + virtual bool ShouldDelayRequest(
|
| + URLRequest* request,
|
| + const ResourceDispatcherHostRequestInfo& request_info,
|
| + const GlobalRequestID& request_id);
|
| + virtual void WillShutdownResourceQueue();
|
|
|
| private:
|
| friend class base::RefCountedThreadSafe<UserScriptListener>;
|
| @@ -53,11 +55,11 @@ class UserScriptListener
|
| // deleted, so user_scripts_ready_ remains unchanged.
|
| void ReplaceURLPatterns(const URLPatterns& patterns);
|
|
|
| - ResourceDispatcherHost* resource_dispatcher_host_;
|
| + ResourceQueue* resource_queue_;
|
|
|
| // A list of every request that we delayed. Will be flushed when user scripts
|
| // are ready.
|
| - typedef std::list<ResourceDispatcherHost::GlobalRequestID> DelayedRequests;
|
| + typedef std::list<GlobalRequestID> DelayedRequests;
|
| DelayedRequests delayed_request_ids_;
|
|
|
| // TODO(mpcomplete): the rest of this stuff should really be per-profile, but
|
| @@ -83,7 +85,7 @@ class UserScriptListener
|
|
|
| NotificationRegistrar registrar_;
|
|
|
| - DISALLOW_EVIL_CONSTRUCTORS(UserScriptListener);
|
| + DISALLOW_COPY_AND_ASSIGN(UserScriptListener);
|
| };
|
|
|
| #endif // CHROME_BROWSER_EXTENSIONS_USER_SCRIPT_LISTENER_H_
|
|
|