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

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: include nit 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // ChromeURLRequestContext* rather than a net::URLRequestContext*. 91 // ChromeURLRequestContext* rather than a net::URLRequestContext*.
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 content::ProtocolHandlerMap* protocol_handlers);
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,
107 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
108 chrome_protocol_handler,
109 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
110 chrome_devtools_protocol_handler);
111 102
112 // Create an instance for an original profile for media. This is expected to 103 // 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 104 // get called on UI thread. This method takes a profile and reuses the
114 // 'original' net::URLRequestContext for common files. 105 // 'original' net::URLRequestContext for common files.
115 static ChromeURLRequestContextGetter* CreateOriginalForMedia( 106 static ChromeURLRequestContextGetter* CreateOriginalForMedia(
116 Profile* profile, const ProfileIOData* profile_io_data); 107 Profile* profile, const ProfileIOData* profile_io_data);
117 108
118 // Create an instance for an original profile for extensions. This is expected 109 // Create an instance for an original profile for extensions. This is expected
119 // to get called on UI thread. 110 // to get called on UI thread.
120 static ChromeURLRequestContextGetter* CreateOriginalForExtensions( 111 static ChromeURLRequestContextGetter* CreateOriginalForExtensions(
121 Profile* profile, const ProfileIOData* profile_io_data); 112 Profile* profile, const ProfileIOData* profile_io_data);
122 113
123 // Create an instance for an original profile for an app with isolated 114 // Create an instance for an original profile for an app with isolated
124 // storage. This is expected to get called on UI thread. 115 // storage. This is expected to get called on UI thread.
125 static ChromeURLRequestContextGetter* CreateOriginalForIsolatedApp( 116 static ChromeURLRequestContextGetter* CreateOriginalForIsolatedApp(
126 Profile* profile, 117 Profile* profile,
127 const ProfileIOData* profile_io_data, 118 const ProfileIOData* profile_io_data,
128 const StoragePartitionDescriptor& partition_descriptor, 119 const StoragePartitionDescriptor& partition_descriptor,
129 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 120 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
130 protocol_handler_interceptor, 121 protocol_handler_interceptor,
131 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> 122 content::ProtocolHandlerMap* protocol_handlers);
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,
137 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
138 chrome_protocol_handler,
139 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
140 chrome_devtools_protocol_handler);
141 123
142 // Create an instance for an original profile for media with isolated 124 // Create an instance for an original profile for media with isolated
143 // storage. This is expected to get called on UI thread. 125 // storage. This is expected to get called on UI thread.
144 static ChromeURLRequestContextGetter* CreateOriginalForIsolatedMedia( 126 static ChromeURLRequestContextGetter* CreateOriginalForIsolatedMedia(
145 Profile* profile, 127 Profile* profile,
146 ChromeURLRequestContextGetter* app_context, 128 ChromeURLRequestContextGetter* app_context,
147 const ProfileIOData* profile_io_data, 129 const ProfileIOData* profile_io_data,
148 const StoragePartitionDescriptor& partition_descriptor); 130 const StoragePartitionDescriptor& partition_descriptor);
149 131
150 // Create an instance for use with an OTR profile. This is expected to get 132 // Create an instance for use with an OTR profile. This is expected to get
151 // called on the UI thread. 133 // called on the UI thread.
152 static ChromeURLRequestContextGetter* CreateOffTheRecord( 134 static ChromeURLRequestContextGetter* CreateOffTheRecord(
153 Profile* profile, 135 Profile* profile,
154 const ProfileIOData* profile_io_data, 136 const ProfileIOData* profile_io_data,
155 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> 137 content::ProtocolHandlerMap* protocol_handlers);
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,
161 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
162 chrome_protocol_handler,
163 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
164 chrome_devtools_protocol_handler);
165 138
166 // Create an instance for an OTR profile for extensions. This is expected 139 // Create an instance for an OTR profile for extensions. This is expected
167 // to get called on UI thread. 140 // to get called on UI thread.
168 static ChromeURLRequestContextGetter* CreateOffTheRecordForExtensions( 141 static ChromeURLRequestContextGetter* CreateOffTheRecordForExtensions(
169 Profile* profile, const ProfileIOData* profile_io_data); 142 Profile* profile, const ProfileIOData* profile_io_data);
170 143
171 // Create an instance for an OTR profile for an app with isolated storage. 144 // Create an instance for an OTR profile for an app with isolated storage.
172 // This is expected to get called on UI thread. 145 // This is expected to get called on UI thread.
173 static ChromeURLRequestContextGetter* CreateOffTheRecordForIsolatedApp( 146 static ChromeURLRequestContextGetter* CreateOffTheRecordForIsolatedApp(
174 Profile* profile, 147 Profile* profile,
175 const ProfileIOData* profile_io_data, 148 const ProfileIOData* profile_io_data,
176 const StoragePartitionDescriptor& partition_descriptor, 149 const StoragePartitionDescriptor& partition_descriptor,
177 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory> 150 scoped_ptr<ProtocolHandlerRegistry::JobInterceptorFactory>
178 protocol_handler_interceptor, 151 protocol_handler_interceptor,
179 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> 152 content::ProtocolHandlerMap* protocol_handlers);
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,
185 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
186 chrome_protocol_handler,
187 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
188 chrome_devtools_protocol_handler);
189 153
190 private: 154 private:
191 virtual ~ChromeURLRequestContextGetter(); 155 virtual ~ChromeURLRequestContextGetter();
192 156
193 // Deferred logic for creating a ChromeURLRequestContext. 157 // Deferred logic for creating a ChromeURLRequestContext.
194 // Access only from the IO thread. 158 // Access only from the IO thread.
195 scoped_ptr<ChromeURLRequestContextFactory> factory_; 159 scoped_ptr<ChromeURLRequestContextFactory> factory_;
196 160
197 // NULL if not yet initialized. Otherwise, it is the ChromeURLRequestContext 161 // NULL if not yet initialized. Otherwise, it is the ChromeURLRequestContext
198 // instance that was lazily created by GetURLRequestContext(). 162 // instance that was lazily created by GetURLRequestContext().
199 // Access only from the IO thread. 163 // Access only from the IO thread.
200 base::WeakPtr<ChromeURLRequestContext> url_request_context_; 164 base::WeakPtr<ChromeURLRequestContext> url_request_context_;
201 165
202 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextGetter); 166 DISALLOW_COPY_AND_ASSIGN(ChromeURLRequestContextGetter);
203 }; 167 };
204 168
205 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_ 169 #endif // CHROME_BROWSER_NET_CHROME_URL_REQUEST_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698