Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Unified Diff: chrome/common/appcache/appcache_dispatcher_host.cc

Issue 258008: Move initialization of ChromeURLRequestContexts to the IO thread. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync again, just in case Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/appcache/appcache_dispatcher_host.h ('k') | chrome/common/appcache/chrome_appcache_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/appcache/appcache_dispatcher_host.cc
===================================================================
--- chrome/common/appcache/appcache_dispatcher_host.cc (revision 29872)
+++ chrome/common/appcache/appcache_dispatcher_host.cc (working copy)
@@ -5,12 +5,14 @@
#include "chrome/common/appcache/appcache_dispatcher_host.h"
#include "chrome/browser/renderer_host/browser_render_process_host.h"
+// TODO(eroman): uh oh, depending on stuff outside of common/
+#include "chrome/browser/net/chrome_url_request_context.h"
#include "chrome/common/appcache/chrome_appcache_service.h"
#include "chrome/common/render_messages.h"
AppCacheDispatcherHost::AppCacheDispatcherHost(
- ChromeAppCacheService* appcache_service)
- : appcache_service_(appcache_service),
+ URLRequestContextGetter* request_context_getter)
+ : request_context_getter_(request_context_getter),
process_handle_(0) {
}
@@ -19,6 +21,13 @@
DCHECK(sender);
DCHECK(process_handle && !process_handle_);
process_handle_ = process_handle;
+
+ // Get the AppCacheService (it can only be accessed from IO thread).
+ URLRequestContext* context = request_context_getter_->GetURLRequestContext();
+ appcache_service_ =
+ static_cast<ChromeURLRequestContext*>(context)->appcache_service();
+ request_context_getter_ = NULL;
+
frontend_proxy_.set_sender(sender);
if (appcache_service_.get()) {
backend_impl_.Initialize(
« no previous file with comments | « chrome/common/appcache/appcache_dispatcher_host.h ('k') | chrome/common/appcache/chrome_appcache_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698