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 CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ |
6 #define CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ | 6 #define CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "base/strings/string_piece.h" | 13 #include "base/strings/string_piece.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "ui/base/layout.h" | 16 #include "ui/base/layout.h" |
| 17 #include "url/gurl.h" |
17 #include "url/url_util.h" | 18 #include "url/url_util.h" |
18 | 19 |
19 class GURL; | |
20 | |
21 namespace base { | 20 namespace base { |
22 class RefCountedMemory; | 21 class RefCountedMemory; |
23 } | 22 } |
24 | 23 |
25 namespace IPC { | 24 namespace IPC { |
26 class Message; | 25 class Message; |
27 } | 26 } |
28 | 27 |
29 namespace gfx { | 28 namespace gfx { |
30 class Image; | 29 class Image; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 85 |
87 // Gives the embedder a chance to register its own pepper plugins. | 86 // Gives the embedder a chance to register its own pepper plugins. |
88 virtual void AddPepperPlugins( | 87 virtual void AddPepperPlugins( |
89 std::vector<content::PepperPluginInfo>* plugins) {} | 88 std::vector<content::PepperPluginInfo>* plugins) {} |
90 | 89 |
91 // Gives the embedder a chance to register the content decryption | 90 // Gives the embedder a chance to register the content decryption |
92 // modules it supports. | 91 // modules it supports. |
93 virtual void AddContentDecryptionModules( | 92 virtual void AddContentDecryptionModules( |
94 std::vector<content::CdmInfo>* cdms) {} | 93 std::vector<content::CdmInfo>* cdms) {} |
95 | 94 |
96 // Gives the embedder a chance to register its own standard, referrer and | 95 // Gives the embedder a chance to register its own schemes early in the |
97 // saveable url schemes early on in the startup sequence. | 96 // startup sequence. |
98 virtual void AddAdditionalSchemes( | 97 // For the secure schemes and origins that need to be considered trustworthy, |
99 std::vector<url::SchemeWithType>* standard_schemes, | 98 // see https://www.w3.org/TR/powerful-features/#is-origin-trustworthy. |
100 std::vector<url::SchemeWithType>* referrer_schemes, | 99 // |service_workers_schemes| are additional schemes that should be allowed to |
101 std::vector<std::string>* savable_schemes) {} | 100 // register service workers. Only secure and trustworthy schemes should be |
| 101 // added. |
| 102 struct Schemes { |
| 103 Schemes(); |
| 104 ~Schemes(); |
| 105 std::vector<std::string> standard_schemes; |
| 106 std::vector<std::string> referrer_schemes; |
| 107 std::vector<std::string> savable_schemes; |
| 108 std::vector<std::string> secure_schemes; |
| 109 std::vector<std::string> service_worker_schemes; |
| 110 std::vector<GURL> secure_origins; |
| 111 }; |
| 112 |
| 113 virtual void AddAdditionalSchemes(Schemes* schemes) {} |
102 | 114 |
103 // Returns whether the given message should be sent in a swapped out renderer. | 115 // Returns whether the given message should be sent in a swapped out renderer. |
104 virtual bool CanSendWhileSwappedOut(const IPC::Message* message); | 116 virtual bool CanSendWhileSwappedOut(const IPC::Message* message); |
105 | 117 |
106 // Returns a string describing the embedder product name and version, | 118 // Returns a string describing the embedder product name and version, |
107 // of the form "productname/version", with no other slashes. | 119 // of the form "productname/version", with no other slashes. |
108 // Used as part of the user agent string. | 120 // Used as part of the user agent string. |
109 virtual std::string GetProduct() const; | 121 virtual std::string GetProduct() const; |
110 | 122 |
111 // Returns the user agent. Content may cache this value. | 123 // Returns the user agent. Content may cache this value. |
(...skipping 24 matching lines...) Expand all Loading... |
136 // for |sandbox_type| are defined by the embedder and should start with | 148 // for |sandbox_type| are defined by the embedder and should start with |
137 // SandboxType::SANDBOX_TYPE_AFTER_LAST_TYPE. Returns false if no sandbox | 149 // SandboxType::SANDBOX_TYPE_AFTER_LAST_TYPE. Returns false if no sandbox |
138 // profile for the given |sandbox_type| exists. Otherwise, | 150 // profile for the given |sandbox_type| exists. Otherwise, |
139 // |sandbox_profile_resource_id| is set to the resource ID corresponding to | 151 // |sandbox_profile_resource_id| is set to the resource ID corresponding to |
140 // the sandbox profile to use and true is returned. | 152 // the sandbox profile to use and true is returned. |
141 virtual bool GetSandboxProfileForSandboxType( | 153 virtual bool GetSandboxProfileForSandboxType( |
142 int sandbox_type, | 154 int sandbox_type, |
143 int* sandbox_profile_resource_id) const; | 155 int* sandbox_profile_resource_id) const; |
144 #endif | 156 #endif |
145 | 157 |
146 // Gives the embedder a chance to register additional schemes and origins | |
147 // that need to be considered trustworthy. | |
148 // See https://www.w3.org/TR/powerful-features/#is-origin-trustworthy. | |
149 virtual void AddSecureSchemesAndOrigins(std::set<std::string>* schemes, | |
150 std::set<GURL>* origins) {} | |
151 | |
152 // Gives the embedder a chance to register additional schemes that | |
153 // should be allowed to register service workers. Only secure and | |
154 // trustworthy schemes should be added. | |
155 virtual void AddServiceWorkerSchemes(std::set<std::string>* schemes) {} | |
156 | |
157 // Returns whether or not V8 script extensions should be allowed for a | 158 // Returns whether or not V8 script extensions should be allowed for a |
158 // service worker. | 159 // service worker. |
159 virtual bool AllowScriptExtensionForServiceWorker(const GURL& script_url); | 160 virtual bool AllowScriptExtensionForServiceWorker(const GURL& script_url); |
160 | 161 |
161 // Returns true if the embedder wishes to supplement the site isolation policy | 162 // Returns true if the embedder wishes to supplement the site isolation policy |
162 // used by the content layer. Returning true enables the infrastructure for | 163 // used by the content layer. Returning true enables the infrastructure for |
163 // out-of-process iframes, and causes the content layer to consult | 164 // out-of-process iframes, and causes the content layer to consult |
164 // ContentBrowserClient::DoesSiteRequireDedicatedProcess() when making process | 165 // ContentBrowserClient::DoesSiteRequireDedicatedProcess() when making process |
165 // model decisions. | 166 // model decisions. |
166 virtual bool IsSupplementarySiteIsolationModeEnabled(); | 167 virtual bool IsSupplementarySiteIsolationModeEnabled(); |
(...skipping 22 matching lines...) Expand all Loading... |
189 ContentGpuClient* gpu_; | 190 ContentGpuClient* gpu_; |
190 // The embedder API for participating in renderer logic. | 191 // The embedder API for participating in renderer logic. |
191 ContentRendererClient* renderer_; | 192 ContentRendererClient* renderer_; |
192 // The embedder API for participating in utility logic. | 193 // The embedder API for participating in utility logic. |
193 ContentUtilityClient* utility_; | 194 ContentUtilityClient* utility_; |
194 }; | 195 }; |
195 | 196 |
196 } // namespace content | 197 } // namespace content |
197 | 198 |
198 #endif // CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ | 199 #endif // CONTENT_PUBLIC_COMMON_CONTENT_CLIENT_H_ |
OLD | NEW |