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

Unified Diff: chrome/browser/profiles/profile_io_data.h

Issue 10836305: Ensure that isolated apps use the right cookies for media requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix nits Created 8 years, 4 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/profile_io_data.h
diff --git a/chrome/browser/profiles/profile_io_data.h b/chrome/browser/profiles/profile_io_data.h
index ff5c4637d188fb7cc56faca703cb74111573d6ee..21f894ca0c33cc26f201de65dafb307520abcc21 100644
--- a/chrome/browser/profiles/profile_io_data.h
+++ b/chrome/browser/profiles/profile_io_data.h
@@ -82,6 +82,9 @@ class ProfileIOData {
ChromeURLRequestContext* GetIsolatedAppRequestContext(
ChromeURLRequestContext* main_context,
const std::string& app_id) const;
+ ChromeURLRequestContext* GetIsolatedMediaRequestContext(
+ ChromeURLRequestContext* media_context,
+ const std::string& app_id) const;
// These are useful when the Chrome layer is called from the content layer
// with a content::ResourceContext, and they want access to Chrome data for
@@ -135,6 +138,22 @@ class ProfileIOData {
bool GetMetricsEnabledStateOnIOThread() const;
protected:
+ // A URLRequestContext for media that owns its HTTP factory, to ensure
+ // it is deleted.
+ class MediaRequestContext : public ChromeURLRequestContext {
+ public:
+ explicit MediaRequestContext(chrome_browser_net::CacheStats* cache_stats);
+
+ void SetHttpTransactionFactory(net::HttpTransactionFactory* http_factory);
+
+ private:
+ virtual ~MediaRequestContext();
+
+ scoped_ptr<net::HttpTransactionFactory> http_factory_;
+ };
+
+ // A URLRequestContext for apps that owns its cookie store and HTTP factory,
+ // to ensure they are deleted.
class AppRequestContext : public ChromeURLRequestContext {
public:
explicit AppRequestContext(chrome_browser_net::CacheStats* cache_stats);
@@ -271,7 +290,7 @@ class ProfileIOData {
};
typedef base::hash_map<std::string, ChromeURLRequestContext*>
- AppRequestContextMap;
+ URLRequestContextMap;
// --------------------------------------------
// Virtual interface for subtypes to implement:
@@ -287,6 +306,12 @@ class ProfileIOData {
ChromeURLRequestContext* main_context,
const std::string& app_id) const = 0;
+ // Does an on-demand initialization of a media RequestContext for the given
+ // isolated app.
+ virtual ChromeURLRequestContext* InitializeMediaRequestContext(
+ ChromeURLRequestContext* original_context,
+ const std::string& app_id) const = 0;
+
// These functions are used to transfer ownership of the lazily initialized
// context from ProfileIOData to the URLRequestContextGetter.
virtual ChromeURLRequestContext*
@@ -295,6 +320,10 @@ class ProfileIOData {
AcquireIsolatedAppRequestContext(
ChromeURLRequestContext* main_context,
const std::string& app_id) const = 0;
+ virtual ChromeURLRequestContext*
+ AcquireIsolatedMediaRequestContext(
+ ChromeURLRequestContext* app_context,
+ const std::string& app_id) const = 0;
// Returns the CacheStats object to be used for this profile.
virtual chrome_browser_net::CacheStats* GetCacheStats(
@@ -362,8 +391,9 @@ class ProfileIOData {
// called.
mutable scoped_ptr<ChromeURLRequestContext> main_request_context_;
mutable scoped_ptr<ChromeURLRequestContext> extensions_request_context_;
- // One AppRequestContext per isolated app.
- mutable AppRequestContextMap app_request_context_map_;
+ // One URLRequestContext per isolated app for main and media requests.
+ mutable URLRequestContextMap app_request_context_map_;
+ mutable URLRequestContextMap isolated_media_request_context_map_;
mutable scoped_ptr<ResourceContext> resource_context_;

Powered by Google App Engine
This is Rietveld 408576698