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

Side by Side Diff: extensions/common/extension_api.h

Issue 2254383002: Signal extension API schema corruption to the browser process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweak comments Created 4 years, 4 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 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 EXTENSIONS_COMMON_EXTENSION_API_H_ 5 #ifndef EXTENSIONS_COMMON_EXTENSION_API_H_
6 #define EXTENSIONS_COMMON_EXTENSION_API_H_ 6 #define EXTENSIONS_COMMON_EXTENSION_API_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // Determines whether an API, or any parts of that API, are available in 99 // Determines whether an API, or any parts of that API, are available in
100 // |context|. 100 // |context|.
101 bool IsAnyFeatureAvailableToContext(const Feature& api, 101 bool IsAnyFeatureAvailableToContext(const Feature& api,
102 const Extension* extension, 102 const Extension* extension,
103 Feature::Context context, 103 Feature::Context context,
104 const GURL& url); 104 const GURL& url);
105 105
106 // Returns true if |name| is available to WebUI contexts on |url|. 106 // Returns true if |name| is available to WebUI contexts on |url|.
107 bool IsAvailableToWebUI(const std::string& name, const GURL& url); 107 bool IsAvailableToWebUI(const std::string& name, const GURL& url);
108 108
109 // Gets the schema for the extension API with namespace |full_name|. 109 // Gets the schema for the extension API with namespace |full_name|, or
110 // nullptr if the schema could not be loaded.
110 // Ownership remains with this object. 111 // Ownership remains with this object.
111 const base::DictionaryValue* GetSchema(const std::string& full_name); 112 const base::DictionaryValue* GetSchema(const std::string& full_name);
112 113
113 // Splits a full name from the extension API into its API and child name 114 // Splits a full name from the extension API into its API and child name
114 // parts. Some examples: 115 // parts. Some examples:
115 // 116 //
116 // "bookmarks.create" -> ("bookmarks", "create") 117 // "bookmarks.create" -> ("bookmarks", "create")
117 // "experimental.input.ui.cursorUp" -> ("experimental.input.ui", "cursorUp") 118 // "experimental.input.ui.cursorUp" -> ("experimental.input.ui", "cursorUp")
118 // "storage.sync.set" -> ("storage", "sync.get") 119 // "storage.sync.set" -> ("storage", "sync.get")
119 // "<unknown-api>.monkey" -> ("", "") 120 // "<unknown-api>.monkey" -> ("", "")
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // FeatureProviders used for resolving dependencies. 152 // FeatureProviders used for resolving dependencies.
152 typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap; 153 typedef std::map<std::string, const FeatureProvider*> FeatureProviderMap;
153 FeatureProviderMap dependency_providers_; 154 FeatureProviderMap dependency_providers_;
154 155
155 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI); 156 DISALLOW_COPY_AND_ASSIGN(ExtensionAPI);
156 }; 157 };
157 158
158 } // namespace extensions 159 } // namespace extensions
159 160
160 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_ 161 #endif // EXTENSIONS_COMMON_EXTENSION_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698