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

Side by Side Diff: content/public/common/content_client.h

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

Powered by Google App Engine
This is Rietveld 408576698