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

Side by Side Diff: chrome/common/extensions/chrome_extensions_client.h

Issue 2506713002: Avoid parsing the webstore base url so much. (Closed)
Patch Set: fix chromeos Created 4 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 CHROME_COMMON_EXTENSIONS_CHROME_EXTENSIONS_CLIENT_H_ 5 #ifndef CHROME_COMMON_EXTENSIONS_CHROME_EXTENSIONS_CLIENT_H_
6 #define CHROME_COMMON_EXTENSIONS_CHROME_EXTENSIONS_CLIENT_H_ 6 #define CHROME_COMMON_EXTENSIONS_CHROME_EXTENSIONS_CLIENT_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 29 matching lines...) Expand all
40 void SetScriptingWhitelist(const ScriptingWhitelist& whitelist) override; 40 void SetScriptingWhitelist(const ScriptingWhitelist& whitelist) override;
41 const ScriptingWhitelist& GetScriptingWhitelist() const override; 41 const ScriptingWhitelist& GetScriptingWhitelist() const override;
42 URLPatternSet GetPermittedChromeSchemeHosts( 42 URLPatternSet GetPermittedChromeSchemeHosts(
43 const Extension* extension, 43 const Extension* extension,
44 const APIPermissionSet& api_permissions) const override; 44 const APIPermissionSet& api_permissions) const override;
45 bool IsScriptableURL(const GURL& url, std::string* error) const override; 45 bool IsScriptableURL(const GURL& url, std::string* error) const override;
46 bool IsAPISchemaGenerated(const std::string& name) const override; 46 bool IsAPISchemaGenerated(const std::string& name) const override;
47 base::StringPiece GetAPISchema(const std::string& name) const override; 47 base::StringPiece GetAPISchema(const std::string& name) const override;
48 bool ShouldSuppressFatalErrors() const override; 48 bool ShouldSuppressFatalErrors() const override;
49 void RecordDidSuppressFatalError() override; 49 void RecordDidSuppressFatalError() override;
50 std::string GetWebstoreBaseURL() const override; 50 const GURL& GetWebstoreBaseURL() const override;
51 const GURL& GetWebstoreUpdateURL() const override; 51 const GURL& GetWebstoreUpdateURL() const override;
52 bool IsBlacklistUpdateURL(const GURL& url) const override; 52 bool IsBlacklistUpdateURL(const GURL& url) const override;
53 std::set<base::FilePath> GetBrowserImagePaths( 53 std::set<base::FilePath> GetBrowserImagePaths(
54 const Extension* extension) override; 54 const Extension* extension) override;
55 bool ExtensionAPIEnabledInExtensionServiceWorkers() const override; 55 bool ExtensionAPIEnabledInExtensionServiceWorkers() const override;
56 56
57 // Get the LazyInstance for ChromeExtensionsClient. 57 // Get the LazyInstance for ChromeExtensionsClient.
58 static ChromeExtensionsClient* GetInstance(); 58 static ChromeExtensionsClient* GetInstance();
59 59
60 private: 60 private:
61 const ChromeAPIPermissions chrome_api_permissions_; 61 const ChromeAPIPermissions chrome_api_permissions_;
62 const ExtensionsAPIPermissions extensions_api_permissions_; 62 const ExtensionsAPIPermissions extensions_api_permissions_;
63 const ChromePermissionMessageProvider permission_message_provider_; 63 const ChromePermissionMessageProvider permission_message_provider_;
64 64
65 // A whitelist of extensions that can script anywhere. Do not add to this 65 // A whitelist of extensions that can script anywhere. Do not add to this
66 // list (except in tests) without consulting the Extensions team first. 66 // list (except in tests) without consulting the Extensions team first.
67 // Note: Component extensions have this right implicitly and do not need to be 67 // Note: Component extensions have this right implicitly and do not need to be
68 // added to this list. 68 // added to this list.
69 ScriptingWhitelist scripting_whitelist_; 69 ScriptingWhitelist scripting_whitelist_;
70 70
71 // Mutable to allow caching in a const method. 71 // Mutable to allow caching in a const method.
72 mutable GURL webstore_base_url_;
72 mutable GURL webstore_update_url_; 73 mutable GURL webstore_update_url_;
73 74
74 friend struct base::DefaultLazyInstanceTraits<ChromeExtensionsClient>; 75 friend struct base::DefaultLazyInstanceTraits<ChromeExtensionsClient>;
75 76
76 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsClient); 77 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionsClient);
77 }; 78 };
78 79
79 } // namespace extensions 80 } // namespace extensions
80 81
81 #endif // CHROME_COMMON_EXTENSIONS_CHROME_EXTENSIONS_CLIENT_H_ 82 #endif // CHROME_COMMON_EXTENSIONS_CHROME_EXTENSIONS_CLIENT_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/ntp_resource_cache.cc ('k') | chrome/common/extensions/chrome_extensions_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698