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

Unified Diff: chrome/browser/profiles/off_the_record_profile_io_data.cc

Issue 6825038: Create a content::ResourceContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Oops, inverted the assertions. Created 9 years, 8 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
Index: chrome/browser/profiles/off_the_record_profile_io_data.cc
diff --git a/chrome/browser/profiles/off_the_record_profile_io_data.cc b/chrome/browser/profiles/off_the_record_profile_io_data.cc
index dc2c66666d9fd0b74ab66d6cfed50013645bd675..f3be936ee97ee28ad3cc3dcb585356274d7da409 100644
--- a/chrome/browser/profiles/off_the_record_profile_io_data.cc
+++ b/chrome/browser/profiles/off_the_record_profile_io_data.cc
@@ -19,8 +19,10 @@
#include "chrome/common/extensions/extension.h"
#include "chrome/common/url_constants.h"
#include "content/browser/browser_thread.h"
+#include "content/browser/resource_context.h"
#include "net/ftp/ftp_network_layer.h"
#include "net/http/http_cache.h"
+#include "webkit/database/database_tracker.h"
OffTheRecordProfileIOData::Handle::Handle(Profile* profile)
: io_data_(new OffTheRecordProfileIOData),
@@ -50,6 +52,13 @@ OffTheRecordProfileIOData::Handle::~Handle() {
}
}
+content::ResourceContextGetter*
+OffTheRecordProfileIOData::Handle::GetResourceContextGetter() const {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ LazyInitialize();
+ return new ProfileResourceContextGetter(io_data_);
+}
+
scoped_refptr<ChromeURLRequestContextGetter>
OffTheRecordProfileIOData::Handle::GetMainRequestContextGetter() const {
// TODO(oshima): Re-enable when ChromeOS only accesses the profile on the UI
@@ -196,6 +205,13 @@ void OffTheRecordProfileIOData::LazyInitializeInternal() const {
main_request_context_->set_http_transaction_factory(cache);
main_request_context_->set_ftp_transaction_factory(
new net::FtpNetworkLayer(main_request_context_->host_resolver()));
+
+ // Initialize ResourceContext.
+
+ scoped_ptr<content::ResourceContext> resource_context(
+ new content::ResourceContext);
+ resource_context->set_database_tracker(profile_params.database_tracker);
+ set_resource_context(resource_context.release());
}
scoped_refptr<ProfileIOData::RequestContext>

Powered by Google App Engine
This is Rietveld 408576698