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

Side by Side Diff: extensions/renderer/api_definitions_natives.cc

Issue 1866103002: [Extensions] Expand bindings access checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 4 years, 8 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
« no previous file with comments | « extensions/extensions.gypi ('k') | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "extensions/renderer/api_definitions_natives.h" 5 #include "extensions/renderer/api_definitions_natives.h"
6 6
7 #include "extensions/common/features/feature.h" 7 #include "extensions/common/features/feature.h"
8 #include "extensions/common/features/feature_provider.h" 8 #include "extensions/common/features/feature_provider.h"
9 #include "extensions/renderer/dispatcher.h" 9 #include "extensions/renderer/dispatcher.h"
10 #include "extensions/renderer/script_context.h" 10 #include "extensions/renderer/script_context.h"
11 11
12 namespace extensions { 12 namespace extensions {
13 13
14 ApiDefinitionsNatives::ApiDefinitionsNatives(Dispatcher* dispatcher, 14 ApiDefinitionsNatives::ApiDefinitionsNatives(Dispatcher* dispatcher,
15 ScriptContext* context) 15 ScriptContext* context)
16 : ObjectBackedNativeHandler(context), dispatcher_(dispatcher) { 16 : ObjectBackedNativeHandler(context), dispatcher_(dispatcher) {
17 RouteFunction( 17 RouteFunction(
18 "GetExtensionAPIDefinitionsForTest", 18 "GetExtensionAPIDefinitionsForTest", "test",
19 base::Bind(&ApiDefinitionsNatives::GetExtensionAPIDefinitionsForTest, 19 base::Bind(&ApiDefinitionsNatives::GetExtensionAPIDefinitionsForTest,
20 base::Unretained(this))); 20 base::Unretained(this)));
21 } 21 }
22 22
23 void ApiDefinitionsNatives::GetExtensionAPIDefinitionsForTest( 23 void ApiDefinitionsNatives::GetExtensionAPIDefinitionsForTest(
24 const v8::FunctionCallbackInfo<v8::Value>& args) { 24 const v8::FunctionCallbackInfo<v8::Value>& args) {
25 std::vector<std::string> apis; 25 std::vector<std::string> apis;
26 const FeatureProvider* feature_provider = FeatureProvider::GetAPIFeatures(); 26 const FeatureProvider* feature_provider = FeatureProvider::GetAPIFeatures();
27 for (const auto& map_entry : feature_provider->GetAllFeatures()) { 27 for (const auto& map_entry : feature_provider->GetAllFeatures()) {
28 if (!feature_provider->GetParent(map_entry.second.get()) && 28 if (!feature_provider->GetParent(map_entry.second.get()) &&
29 context()->GetAvailability(map_entry.first).is_available()) { 29 context()->GetAvailability(map_entry.first).is_available()) {
30 apis.push_back(map_entry.first); 30 apis.push_back(map_entry.first);
31 } 31 }
32 } 32 }
33 args.GetReturnValue().Set( 33 args.GetReturnValue().Set(
34 dispatcher_->v8_schema_registry()->GetSchemas(apis)); 34 dispatcher_->v8_schema_registry()->GetSchemas(apis));
35 } 35 }
36 36
37 } // namespace extensions 37 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/extensions.gypi ('k') | extensions/renderer/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698