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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: content/public/common/content_client.h
diff --git a/content/public/common/content_client.h b/content/public/common/content_client.h
index af05bb3e3e9305d64da961357a64a51757430661..ad88fe033e803771147a474a7d77841fac7edb63 100644
--- a/content/public/common/content_client.h
+++ b/content/public/common/content_client.h
@@ -93,12 +93,25 @@ class CONTENT_EXPORT ContentClient {
virtual void AddContentDecryptionModules(
std::vector<content::CdmInfo>* cdms) {}
- // Gives the embedder a chance to register its own standard, referrer and
- // saveable url schemes early on in the startup sequence.
- virtual void AddAdditionalSchemes(
- std::vector<url::SchemeWithType>* standard_schemes,
- std::vector<url::SchemeWithType>* referrer_schemes,
- std::vector<std::string>* savable_schemes) {}
+ // Gives the embedder a chance to register its own schemes early in the
+ // startup sequence.
+ // For the secure schemes and origins that need to be considered trustworthy,
+ // see https://www.w3.org/TR/powerful-features/#is-origin-trustworthy.
+ // |service_workers_schemes| are additional schemes that should be allowed to
+ // register service workers. Only secure and trustworthy schemes should be
+ // added.
+ struct Schemes {
+ Schemes();
+ ~Schemes();
+ std::vector<std::string> standard_schemes;
+ std::vector<std::string> referrer_schemes;
+ std::vector<std::string> savable_schemes;
+ std::vector<std::string> secure_schemes;
+ std::vector<std::string> secure_origins;
+ std::vector<std::string> service_worker_schemes;
+ };
+
+ virtual void AddAdditionalSchemes(Schemes* schemes) {}
// Returns whether the given message should be sent in a swapped out renderer.
virtual bool CanSendWhileSwappedOut(const IPC::Message* message);
@@ -143,17 +156,6 @@ class CONTENT_EXPORT ContentClient {
int* sandbox_profile_resource_id) const;
#endif
- // Gives the embedder a chance to register additional schemes and origins
- // that need to be considered trustworthy.
- // See https://www.w3.org/TR/powerful-features/#is-origin-trustworthy.
- virtual void AddSecureSchemesAndOrigins(std::set<std::string>* schemes,
- std::set<GURL>* origins) {}
-
- // Gives the embedder a chance to register additional schemes that
- // should be allowed to register service workers. Only secure and
- // trustworthy schemes should be added.
- virtual void AddServiceWorkerSchemes(std::set<std::string>* schemes) {}
-
// Returns whether or not V8 script extensions should be allowed for a
// service worker.
virtual bool AllowScriptExtensionForServiceWorker(const GURL& script_url);

Powered by Google App Engine
This is Rietveld 408576698