OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 5 #ifndef CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
6 #define CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 6 #define CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 Profile* profile, | 93 Profile* profile, |
94 const ProfileIOData* profile_io_data, | 94 const ProfileIOData* profile_io_data, |
95 content::ProtocolHandlerMap* protocol_handlers); | 95 content::ProtocolHandlerMap* protocol_handlers); |
96 | 96 |
97 // Create an instance for an original profile for media. This is expected to | 97 // Create an instance for an original profile for media. This is expected to |
98 // get called on UI thread. This method takes a profile and reuses the | 98 // get called on UI thread. This method takes a profile and reuses the |
99 // 'original' net::URLRequestContext for common files. | 99 // 'original' net::URLRequestContext for common files. |
100 static ChromeURLRequestContextGetter* CreateOriginalForMedia( | 100 static ChromeURLRequestContextGetter* CreateOriginalForMedia( |
101 Profile* profile, const ProfileIOData* profile_io_data); | 101 Profile* profile, const ProfileIOData* profile_io_data); |
102 | 102 |
| 103 // Create an instance for an original profile for extensions. This is expected |
| 104 // to get called on UI thread. |
| 105 static ChromeURLRequestContextGetter* CreateOriginalForExtensions( |
| 106 Profile* profile, const ProfileIOData* profile_io_data); |
| 107 |
103 // Create an instance for an original profile for an app with isolated | 108 // Create an instance for an original profile for an app with isolated |
104 // storage. This is expected to get called on UI thread. | 109 // storage. This is expected to get called on UI thread. |
105 static ChromeURLRequestContextGetter* CreateOriginalForIsolatedApp( | 110 static ChromeURLRequestContextGetter* CreateOriginalForIsolatedApp( |
106 Profile* profile, | 111 Profile* profile, |
107 const ProfileIOData* profile_io_data, | 112 const ProfileIOData* profile_io_data, |
108 const StoragePartitionDescriptor& partition_descriptor, | 113 const StoragePartitionDescriptor& partition_descriptor, |
109 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 114 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
110 protocol_handler_interceptor, | 115 protocol_handler_interceptor, |
111 content::ProtocolHandlerMap* protocol_handlers); | 116 content::ProtocolHandlerMap* protocol_handlers); |
112 | 117 |
113 // Create an instance for an original profile for media with isolated | 118 // Create an instance for an original profile for media with isolated |
114 // storage. This is expected to get called on UI thread. | 119 // storage. This is expected to get called on UI thread. |
115 static ChromeURLRequestContextGetter* CreateOriginalForIsolatedMedia( | 120 static ChromeURLRequestContextGetter* CreateOriginalForIsolatedMedia( |
116 Profile* profile, | 121 Profile* profile, |
117 ChromeURLRequestContextGetter* app_context, | 122 ChromeURLRequestContextGetter* app_context, |
118 const ProfileIOData* profile_io_data, | 123 const ProfileIOData* profile_io_data, |
119 const StoragePartitionDescriptor& partition_descriptor); | 124 const StoragePartitionDescriptor& partition_descriptor); |
120 | 125 |
121 // Create an instance for use with an OTR profile. This is expected to get | 126 // Create an instance for use with an OTR profile. This is expected to get |
122 // called on the UI thread. | 127 // called on the UI thread. |
123 static ChromeURLRequestContextGetter* CreateOffTheRecord( | 128 static ChromeURLRequestContextGetter* CreateOffTheRecord( |
124 Profile* profile, | 129 Profile* profile, |
125 const ProfileIOData* profile_io_data, | 130 const ProfileIOData* profile_io_data, |
126 content::ProtocolHandlerMap* protocol_handlers); | 131 content::ProtocolHandlerMap* protocol_handlers); |
127 | 132 |
| 133 // Create an instance for an OTR profile for extensions. This is expected |
| 134 // to get called on UI thread. |
| 135 static ChromeURLRequestContextGetter* CreateOffTheRecordForExtensions( |
| 136 Profile* profile, const ProfileIOData* profile_io_data); |
| 137 |
128 // Create an instance for an OTR profile for an app with isolated storage. | 138 // Create an instance for an OTR profile for an app with isolated storage. |
129 // This is expected to get called on UI thread. | 139 // This is expected to get called on UI thread. |
130 static ChromeURLRequestContextGetter* CreateOffTheRecordForIsolatedApp( | 140 static ChromeURLRequestContextGetter* CreateOffTheRecordForIsolatedApp( |
131 Profile* profile, | 141 Profile* profile, |
132 const ProfileIOData* profile_io_data, | 142 const ProfileIOData* profile_io_data, |
133 const StoragePartitionDescriptor& partition_descriptor, | 143 const StoragePartitionDescriptor& partition_descriptor, |
134 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> | 144 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> |
135 protocol_handler_interceptor, | 145 protocol_handler_interceptor, |
136 content::ProtocolHandlerMap* protocol_handlers); | 146 content::ProtocolHandlerMap* protocol_handlers); |
137 | 147 |
138 private: | 148 private: |
139 virtual ~ChromeURLRequestContextGetter(); | 149 virtual ~ChromeURLRequestContextGetter(); |
140 | 150 |
141 // Deferred logic for creating a ChromeURLRequestContext. | 151 // Deferred logic for creating a ChromeURLRequestContext. |
142 // Access only from the IO thread. | 152 // Access only from the IO thread. |
143 scoped_ptr<ChromeURLRequestContextFactory> factory_; | 153 scoped_ptr<ChromeURLRequestContextFactory> factory_; |
144 | 154 |
145 // NULL if not yet initialized. Otherwise, it is the ChromeURLRequestContext | 155 // NULL if not yet initialized. Otherwise, it is the ChromeURLRequestContext |
146 // instance that was lazily created by GetURLRequestContext(). | 156 // instance that was lazily created by GetURLRequestContext(). |
147 // Access only from the IO thread. | 157 // Access only from the IO thread. |
148 base::WeakPtr<ChromeURLRequestContext> url_request_context_; | 158 base::WeakPtr<ChromeURLRequestContext> url_request_context_; |
149 | 159 |
150 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextGetter); | 160 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextGetter); |
151 }; | 161 }; |
152 | 162 |
153 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ | 163 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ |
OLD | NEW |