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

Side by Side Diff: chrome/renderer/extensions/automation_internal_custom_bindings.cc

Issue 1854983002: [Extensions] Add more bindings access checks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment 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 | « no previous file | chrome/renderer/extensions/cast_streaming_native_handler.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 "chrome/renderer/extensions/automation_internal_custom_bindings.h" 5 #include "chrome/renderer/extensions/automation_internal_custom_bindings.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 411
412 AutomationInternalCustomBindings::AutomationInternalCustomBindings( 412 AutomationInternalCustomBindings::AutomationInternalCustomBindings(
413 ScriptContext* context) 413 ScriptContext* context)
414 : ObjectBackedNativeHandler(context), 414 : ObjectBackedNativeHandler(context),
415 is_active_profile_(true), 415 is_active_profile_(true),
416 tree_change_observer_overall_filter_( 416 tree_change_observer_overall_filter_(
417 api::automation::TREE_CHANGE_OBSERVER_FILTER_NOTREECHANGES) { 417 api::automation::TREE_CHANGE_OBSERVER_FILTER_NOTREECHANGES) {
418 // It's safe to use base::Unretained(this) here because these bindings 418 // It's safe to use base::Unretained(this) here because these bindings
419 // will only be called on a valid AutomationInternalCustomBindings instance 419 // will only be called on a valid AutomationInternalCustomBindings instance
420 // and none of the functions have any side effects. 420 // and none of the functions have any side effects.
421 #define ROUTE_FUNCTION(FN) \ 421 #define ROUTE_FUNCTION(FN) \
422 RouteFunction(#FN, \ 422 RouteFunction(#FN, "automation", \
423 base::Bind(&AutomationInternalCustomBindings::FN, \ 423 base::Bind(&AutomationInternalCustomBindings::FN, \
424 base::Unretained(this))) 424 base::Unretained(this)))
425 ROUTE_FUNCTION(IsInteractPermitted); 425 ROUTE_FUNCTION(IsInteractPermitted);
426 ROUTE_FUNCTION(GetSchemaAdditions); 426 ROUTE_FUNCTION(GetSchemaAdditions);
427 ROUTE_FUNCTION(GetRoutingID); 427 ROUTE_FUNCTION(GetRoutingID);
428 ROUTE_FUNCTION(StartCachingAccessibilityTrees); 428 ROUTE_FUNCTION(StartCachingAccessibilityTrees);
429 ROUTE_FUNCTION(DestroyAccessibilityTree); 429 ROUTE_FUNCTION(DestroyAccessibilityTree);
430 ROUTE_FUNCTION(AddTreeChangeObserver); 430 ROUTE_FUNCTION(AddTreeChangeObserver);
431 ROUTE_FUNCTION(RemoveTreeChangeObserver); 431 ROUTE_FUNCTION(RemoveTreeChangeObserver);
432 ROUTE_FUNCTION(GetChildIDAtIndex); 432 ROUTE_FUNCTION(GetChildIDAtIndex);
433 ROUTE_FUNCTION(GetFocus); 433 ROUTE_FUNCTION(GetFocus);
434 ROUTE_FUNCTION(GetState); 434 ROUTE_FUNCTION(GetState);
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after
1228 v8::Local<v8::Array> args(v8::Array::New(GetIsolate(), 2U)); 1228 v8::Local<v8::Array> args(v8::Array::New(GetIsolate(), 2U));
1229 args->Set(0U, v8::Integer::New(GetIsolate(), tree_id)); 1229 args->Set(0U, v8::Integer::New(GetIsolate(), tree_id));
1230 v8::Local<v8::Array> nodes(v8::Array::New(GetIsolate(), ids.size())); 1230 v8::Local<v8::Array> nodes(v8::Array::New(GetIsolate(), ids.size()));
1231 args->Set(1U, nodes); 1231 args->Set(1U, nodes);
1232 for (size_t i = 0; i < ids.size(); ++i) 1232 for (size_t i = 0; i < ids.size(); ++i)
1233 nodes->Set(i, v8::Integer::New(GetIsolate(), ids[i])); 1233 nodes->Set(i, v8::Integer::New(GetIsolate(), ids[i]));
1234 context()->DispatchEvent("automationInternal.onNodesRemoved", args); 1234 context()->DispatchEvent("automationInternal.onNodesRemoved", args);
1235 } 1235 }
1236 1236
1237 } // namespace extensions 1237 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/extensions/cast_streaming_native_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698