diff options
Diffstat (limited to 'content/browser/appcache')
-rw-r--r-- | content/browser/appcache/appcache_dispatcher_host.cc | 27 | ||||
-rw-r--r-- | content/browser/appcache/appcache_dispatcher_host.h | 19 |
2 files changed, 11 insertions, 35 deletions
diff --git a/content/browser/appcache/appcache_dispatcher_host.cc b/content/browser/appcache/appcache_dispatcher_host.cc index b4dc118..955b4fc 100644 --- a/content/browser/appcache/appcache_dispatcher_host.cc +++ b/content/browser/appcache/appcache_dispatcher_host.cc @@ -8,24 +8,16 @@ #include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "content/browser/appcache/chrome_appcache_service.h" +#include "content/browser/resource_context.h" #include "content/common/appcache_messages.h" AppCacheDispatcherHost::AppCacheDispatcherHost( - net::URLRequestContext* request_context, + const content::ResourceContext* resource_context, int process_id) : ALLOW_THIS_IN_INITIALIZER_LIST(frontend_proxy_(this)), - request_context_(request_context), + resource_context_(resource_context), process_id_(process_id) { - DCHECK(request_context_.get()); -} - -AppCacheDispatcherHost::AppCacheDispatcherHost( - net::URLRequestContextGetter* request_context_getter, - int process_id) - : ALLOW_THIS_IN_INITIALIZER_LIST(frontend_proxy_(this)), - request_context_getter_(request_context_getter), - process_id_(process_id) { - DCHECK(request_context_getter_.get()); + DCHECK(resource_context_); } AppCacheDispatcherHost::~AppCacheDispatcherHost() {} @@ -33,16 +25,9 @@ AppCacheDispatcherHost::~AppCacheDispatcherHost() {} void AppCacheDispatcherHost::OnChannelConnected(int32 peer_pid) { BrowserMessageFilter::OnChannelConnected(peer_pid); - DCHECK(request_context_.get() || request_context_getter_.get()); - // Get the AppCacheService (it can only be accessed from IO thread). - net::URLRequestContext* context = request_context_.get(); - if (!context) - context = request_context_getter_->GetURLRequestContext(); - appcache_service_ = - static_cast<ChromeURLRequestContext*>(context)->appcache_service(); - request_context_ = NULL; - request_context_getter_ = NULL; + appcache_service_ = resource_context_->appcache_service(); + resource_context_ = NULL; if (appcache_service_.get()) { backend_impl_.Initialize( diff --git a/content/browser/appcache/appcache_dispatcher_host.h b/content/browser/appcache/appcache_dispatcher_host.h index 8ff8044..776ef04 100644 --- a/content/browser/appcache/appcache_dispatcher_host.h +++ b/content/browser/appcache/appcache_dispatcher_host.h @@ -17,11 +17,9 @@ #include "webkit/appcache/appcache_backend_impl.h" class ChromeAppCacheService; - -namespace net { -class URLRequestContext; -class URLRequestContextGetter; -} // namespace net +namespace content { +class ResourceContext; +} // namespace content // Handles appcache related messages sent to the main browser process from // its child processes. There is a distinct host for each child process. @@ -29,14 +27,8 @@ class URLRequestContextGetter; // WorkerProcessHost create an instance and delegates calls to it. class AppCacheDispatcherHost : public BrowserMessageFilter { public: - // Constructor for use on the IO thread. - AppCacheDispatcherHost(net::URLRequestContext* request_context, - int process_id); - - // Constructor for use on the UI thread. - AppCacheDispatcherHost(net::URLRequestContextGetter* request_context_getter, + AppCacheDispatcherHost(const content::ResourceContext* resource_context, int process_id); - ~AppCacheDispatcherHost(); // BrowserIOMessageFilter implementation @@ -80,8 +72,7 @@ class AppCacheDispatcherHost : public BrowserMessageFilter { // Temporary until OnChannelConnected() can be called from the IO thread, // which will extract the AppCacheService from the net::URLRequestContext. - scoped_refptr<net::URLRequestContext> request_context_; - scoped_refptr<net::URLRequestContextGetter> request_context_getter_; + const content::ResourceContext* resource_context_; scoped_ptr<appcache::GetStatusCallback> get_status_callback_; scoped_ptr<appcache::StartUpdateCallback> start_update_callback_; |