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

Unified Diff: chrome/browser/profile.cc

Issue 19747: URLRequestContext and disk cache for media files (Closed)
Patch Set: signed and unsigned... Created 11 years, 10 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/browser/profile.h ('k') | chrome/common/chrome_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profile.cc
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 7c7041e5e88d0700cbb8ba0b97a4223880e6fd32..710949faf61077ae6209b0a9ae397b5a995ebe73 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -207,6 +207,20 @@ class OffTheRecordProfileImpl : public Profile,
return request_context_;
}
+ virtual URLRequestContext* GetRequestContextForMedia() {
+ if (!media_request_context_) {
+ FilePath cache_path = GetPath();
+ cache_path.Append(chrome::kOffTheRecordMediaCacheDirname);
+ media_request_context_ =
+ ChromeURLRequestContext::CreateOffTheRecordForMedia(
+ this, cache_path);
+ media_request_context_->AddRef();
+
+ DCHECK(media_request_context_->cookie_store());
+ }
+ return media_request_context_;
+ }
+
virtual SessionService* GetSessionService() {
// Don't save any sessions when off the record.
return NULL;
@@ -311,6 +325,9 @@ class OffTheRecordProfileImpl : public Profile,
// The context to use for requests made from this OTR session.
ChromeURLRequestContext* request_context_;
+ // The context for requests for media resources.
+ ChromeURLRequestContext* media_request_context_;
+
// The download manager that only stores downloaded items in memory.
scoped_refptr<DownloadManager> download_manager_;
@@ -586,6 +603,20 @@ URLRequestContext* ProfileImpl::GetRequestContext() {
return request_context_;
}
+URLRequestContext* ProfileImpl::GetRequestContextForMedia() {
+ if (!media_request_context_) {
+ FilePath cache_path = GetPath();
+ cache_path.Append(chrome::kMediaCacheDirname);
+ media_request_context_ = ChromeURLRequestContext::CreateOriginalForMedia(
+ this, cache_path);
+ media_request_context_->AddRef();
+
+ DCHECK(media_request_context_->cookie_store());
+ }
+
+ return media_request_context_;
+}
+
HistoryService* ProfileImpl::GetHistoryService(ServiceAccessType sat) {
if (!history_service_created_) {
history_service_created_ = true;
« no previous file with comments | « chrome/browser/profile.h ('k') | chrome/common/chrome_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698