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

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: merge 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
« no previous file with comments | « content/common/url_schemes.cc ('k') | content/public/common/content_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..1974ba031a4c2a35dc29329790423752c77854fb 100644
--- a/content/public/common/content_client.h
+++ b/content/public/common/content_client.h
@@ -14,10 +14,9 @@
#include "build/build_config.h"
#include "content/common/content_export.h"
#include "ui/base/layout.h"
+#include "url/gurl.h"
#include "url/url_util.h"
-class GURL;
-
namespace base {
class RefCountedMemory;
}
@@ -93,12 +92,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> service_worker_schemes;
+ std::vector<GURL> secure_origins;
+ };
+
+ 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 +155,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);
« no previous file with comments | « content/common/url_schemes.cc ('k') | content/public/common/content_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698