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

Side by Side Diff: content/public/browser/content_browser_client.h

Issue 11308362: Add StoragePartition's ProtocolHandlers at URLRequestContext construction time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address awong's comments Created 7 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 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 CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
6 #define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 6 #define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/callback_forward.h" 12 #include "base/callback_forward.h"
13 #include "base/memory/scoped_ptr.h"
13 #include "content/public/browser/file_descriptor_info.h" 14 #include "content/public/browser/file_descriptor_info.h"
14 #include "content/public/common/socket_permission_request.h" 15 #include "content/public/common/socket_permission_request.h"
15 #include "content/public/common/content_client.h" 16 #include "content/public/common/content_client.h"
16 #include "content/public/common/window_container_type.h" 17 #include "content/public/common/window_container_type.h"
17 #include "net/base/mime_util.h" 18 #include "net/base/mime_util.h"
18 #include "net/cookies/canonical_cookie.h" 19 #include "net/cookies/canonical_cookie.h"
20 #include "net/url_request/url_request_job_factory.h"
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresen ter.h" 21 #include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresen ter.h"
20 22
21 #if defined(OS_POSIX) && !defined(OS_MACOSX) 23 #if defined(OS_POSIX) && !defined(OS_MACOSX)
22 #include "base/posix/global_descriptors.h" 24 #include "base/posix/global_descriptors.h"
23 #endif 25 #endif
24 26
25 class CommandLine; 27 class CommandLine;
26 class GURL; 28 class GURL;
27 29
28 namespace base { 30 namespace base {
(...skipping 13 matching lines...) Expand all
42 } 44 }
43 45
44 namespace net { 46 namespace net {
45 class CookieOptions; 47 class CookieOptions;
46 class HttpNetworkSession; 48 class HttpNetworkSession;
47 class NetLog; 49 class NetLog;
48 class SSLCertRequestInfo; 50 class SSLCertRequestInfo;
49 class SSLInfo; 51 class SSLInfo;
50 class URLRequest; 52 class URLRequest;
51 class URLRequestContext; 53 class URLRequestContext;
54 class URLRequestContextGetter;
52 class X509Certificate; 55 class X509Certificate;
53 } 56 }
54 57
55 namespace ui { 58 namespace ui {
56 class SelectFilePolicy; 59 class SelectFilePolicy;
57 } 60 }
58 61
59 namespace content { 62 namespace content {
60 63
61 class AccessTokenStore; 64 class AccessTokenStore;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // Get the effective URL for the given actual URL, to allow an embedder to 131 // Get the effective URL for the given actual URL, to allow an embedder to
129 // group different url schemes in the same SiteInstance. 132 // group different url schemes in the same SiteInstance.
130 virtual GURL GetEffectiveURL(BrowserContext* browser_context, 133 virtual GURL GetEffectiveURL(BrowserContext* browser_context,
131 const GURL& url); 134 const GURL& url);
132 135
133 // Returns whether all instances of the specified effective URL should be 136 // Returns whether all instances of the specified effective URL should be
134 // rendered by the same process, rather than using process-per-site-instance. 137 // rendered by the same process, rather than using process-per-site-instance.
135 virtual bool ShouldUseProcessPerSite(BrowserContext* browser_context, 138 virtual bool ShouldUseProcessPerSite(BrowserContext* browser_context,
136 const GURL& effective_url); 139 const GURL& effective_url);
137 140
141 // Creates the main net::URLRequestContextGetter. Should only be called once
142 // per ContentBrowserClient object.
143 // TODO(ajwong): Remove once http://crbug.com/159193 is resolved.
144 virtual net::URLRequestContextGetter* CreateRequestContext(
145 BrowserContext* browser_context,
146 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
147 blob_protocol_handler,
148 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
149 file_system_protocol_handler,
150 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
151 developer_protocol_handler,
152 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
153 chrome_protocol_handler,
154 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
155 chrome_devtools_protocol_handler);
156
157 // Creates the net::URLRequestContextGetter for a StoragePartition. Should
158 // only be called once per partition_path per ContentBrowserClient object.
159 // TODO(ajwong): Remove once http://crbug.com/159193 is resolved.
160 virtual net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
161 BrowserContext* browser_context,
162 const FilePath& partition_path,
163 bool in_memory,
164 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
165 blob_protocol_handler,
166 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
167 file_system_protocol_handler,
168 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
169 developer_protocol_handler,
170 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
171 chrome_protocol_handler,
172 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>
173 chrome_devtools_protocol_handler);
174
138 // Returns whether a specified URL is handled by the embedder's internal 175 // Returns whether a specified URL is handled by the embedder's internal
139 // protocol handlers. 176 // protocol handlers.
140 virtual bool IsHandledURL(const GURL& url); 177 virtual bool IsHandledURL(const GURL& url);
141 178
142 // Returns whether a new view for a given |site_url| can be launched in a 179 // Returns whether a new view for a given |site_url| can be launched in a
143 // given |process_host|. 180 // given |process_host|.
144 virtual bool IsSuitableHost(RenderProcessHost* process_host, 181 virtual bool IsSuitableHost(RenderProcessHost* process_host,
145 const GURL& site_url); 182 const GURL& site_url);
146 183
147 // Returns whether a new process should be created or an existing one should 184 // Returns whether a new process should be created or an existing one should
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 // This is called on a worker thread. 508 // This is called on a worker thread.
472 virtual 509 virtual
473 crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate( 510 crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate(
474 const GURL& url); 511 const GURL& url);
475 #endif 512 #endif
476 }; 513 };
477 514
478 } // namespace content 515 } // namespace content
479 516
480 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ 517 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698