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

Side by Side Diff: chrome/browser/net/chrome_url_request_context.h

Issue 11896113: Add chrome-search: access from Instant overlay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Charlie's comments. Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 ChromeURLRequestContext* GetIOContext() { 92 ChromeURLRequestContext* GetIOContext() {
93 return reinterpret_cast<ChromeURLRequestContext*>(GetURLRequestContext()); 93 return reinterpret_cast<ChromeURLRequestContext*>(GetURLRequestContext());
94 } 94 }
95 95
96 // Create an instance for use with an 'original' (non-OTR) profile. This is 96 // Create an instance for use with an 'original' (non-OTR) profile. This is
97 // expected to get called on the UI thread. 97 // expected to get called on the UI thread.
98 static ChromeURLRequestContextGetter* CreateOriginal( 98 static ChromeURLRequestContextGetter* CreateOriginal(
99 Profile* profile, 99 Profile* profile,
100 const ProfileIOData* profile_io_data, 100 const ProfileIOData* profile_io_data,
101 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> 101 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
102 blob_protocol_handler,
103 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
104 file_system_protocol_handler,
105 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
106 developer_protocol_handler, 102 developer_protocol_handler,
107 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> 103 content::ProtocolHandlerMap* protocol_handlers);
108 chrome_protocol_handler,
109 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
110 chrome_devtools_protocol_handler);
111 104
112 // Create an instance for an original profile for media. This is expected to 105 // Create an instance for an original profile for media. This is expected to
113 // get called on UI thread. This method takes a profile and reuses the 106 // get called on UI thread. This method takes a profile and reuses the
114 // 'original' net::URLRequestContext for common files. 107 // 'original' net::URLRequestContext for common files.
115 static ChromeURLRequestContextGetter* CreateOriginalForMedia( 108 static ChromeURLRequestContextGetter* CreateOriginalForMedia(
116 Profile* profile, const ProfileIOData* profile_io_data); 109 Profile* profile, const ProfileIOData* profile_io_data);
117 110
118 // Create an instance for an original profile for extensions. This is expected 111 // Create an instance for an original profile for extensions. This is expected
119 // to get called on UI thread. 112 // to get called on UI thread.
120 static ChromeURLRequestContextGetter* CreateOriginalForExtensions( 113 static ChromeURLRequestContextGetter* CreateOriginalForExtensions(
121 Profile* profile, const ProfileIOData* profile_io_data); 114 Profile* profile, const ProfileIOData* profile_io_data);
122 115
123 // Create an instance for an original profile for an app with isolated 116 // Create an instance for an original profile for an app with isolated
124 // storage. This is expected to get called on UI thread. 117 // storage. This is expected to get called on UI thread.
125 static ChromeURLRequestContextGetter* CreateOriginalForIsolatedApp( 118 static ChromeURLRequestContextGetter* CreateOriginalForIsolatedApp(
126 Profile* profile, 119 Profile* profile,
127 const ProfileIOData* profile_io_data, 120 const ProfileIOData* profile_io_data,
128 const StoragePartitionDescriptor& partition_descriptor, 121 const StoragePartitionDescriptor& partition_descriptor,
129 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 122 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
130 protocol_handler_interceptor, 123 protocol_handler_interceptor,
131 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> 124 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
132 blob_protocol_handler,
133 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
134 file_system_protocol_handler,
135 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
136 developer_protocol_handler, 125 developer_protocol_handler,
137 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> 126 content::ProtocolHandlerMap* protocol_handlers);
138 chrome_protocol_handler,
139 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
140 chrome_devtools_protocol_handler);
141 127
142 // Create an instance for an original profile for media with isolated 128 // Create an instance for an original profile for media with isolated
143 // storage. This is expected to get called on UI thread. 129 // storage. This is expected to get called on UI thread.
144 static ChromeURLRequestContextGetter* CreateOriginalForIsolatedMedia( 130 static ChromeURLRequestContextGetter* CreateOriginalForIsolatedMedia(
145 Profile* profile, 131 Profile* profile,
146 ChromeURLRequestContextGetter* app_context, 132 ChromeURLRequestContextGetter* app_context,
147 const ProfileIOData* profile_io_data, 133 const ProfileIOData* profile_io_data,
148 const StoragePartitionDescriptor& partition_descriptor); 134 const StoragePartitionDescriptor& partition_descriptor);
149 135
150 // Create an instance for use with an OTR profile. This is expected to get 136 // Create an instance for use with an OTR profile. This is expected to get
151 // called on the UI thread. 137 // called on the UI thread.
152 static ChromeURLRequestContextGetter* CreateOffTheRecord( 138 static ChromeURLRequestContextGetter* CreateOffTheRecord(
153 Profile* profile, 139 Profile* profile,
154 const ProfileIOData* profile_io_data, 140 const ProfileIOData* profile_io_data,
155 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> 141 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
156 blob_protocol_handler,
157 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
158 file_system_protocol_handler,
159 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
160 developer_protocol_handler, 142 developer_protocol_handler,
161 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> 143 content::ProtocolHandlerMap* protocol_handlers);
162 chrome_protocol_handler,
163 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
164 chrome_devtools_protocol_handler);
165 144
166 // Create an instance for an OTR profile for extensions. This is expected 145 // Create an instance for an OTR profile for extensions. This is expected
167 // to get called on UI thread. 146 // to get called on UI thread.
168 static ChromeURLRequestContextGetter* CreateOffTheRecordForExtensions( 147 static ChromeURLRequestContextGetter* CreateOffTheRecordForExtensions(
169 Profile* profile, const ProfileIOData* profile_io_data); 148 Profile* profile, const ProfileIOData* profile_io_data);
170 149
171 // Create an instance for an OTR profile for an app with isolated storage. 150 // Create an instance for an OTR profile for an app with isolated storage.
172 // This is expected to get called on UI thread. 151 // This is expected to get called on UI thread.
173 static ChromeURLRequestContextGetter* CreateOffTheRecordForIsolatedApp( 152 static ChromeURLRequestContextGetter* CreateOffTheRecordForIsolatedApp(
174 Profile* profile, 153 Profile* profile,
175 const ProfileIOData* profile_io_data, 154 const ProfileIOData* profile_io_data,
176 const StoragePartitionDescriptor& partition_descriptor, 155 const StoragePartitionDescriptor& partition_descriptor,
177 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 156 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
178 protocol_handler_interceptor, 157 protocol_handler_interceptor,
179 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> 158 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
180 blob_protocol_handler,
181 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
182 file_system_protocol_handler,
183 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
184 developer_protocol_handler, 159 developer_protocol_handler,
185 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> 160 content::ProtocolHandlerMap* protocol_handlers);
186 chrome_protocol_handler,
187 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
188 chrome_devtools_protocol_handler);
189 161
190 private: 162 private:
191 virtual ~ChromeURLRequestContextGetter(); 163 virtual ~ChromeURLRequestContextGetter();
192 164
193 // Deferred logic for creating a ChromeURLRequestContext. 165 // Deferred logic for creating a ChromeURLRequestContext.
194 // Access only from the IO thread. 166 // Access only from the IO thread.
195 scoped_ptr<ChromeURLRequestContextFactory> factory_; 167 scoped_ptr<ChromeURLRequestContextFactory> factory_;
196 168
197 // NULL if not yet initialized. Otherwise, it is the ChromeURLRequestContext 169 // NULL if not yet initialized. Otherwise, it is the ChromeURLRequestContext
198 // instance that was lazily created by GetURLRequestContext(). 170 // instance that was lazily created by GetURLRequestContext().
199 // Access only from the IO thread. 171 // Access only from the IO thread.
200 base::WeakPtr<ChromeURLRequestContext> url_request_context_; 172 base::WeakPtr<ChromeURLRequestContext> url_request_context_;
201 173
202 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextGetter); 174 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextGetter);
203 }; 175 };
204 176
205 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ 177 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698