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

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

Issue 2961103002: [Extensions Bindings] Add an ExceptionHandler class (Closed)
Patch Set: rebase + nits Created 3 years, 5 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/renderer/bindings/exception_handler_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/native_extension_bindings_system.h" 5 #include "extensions/renderer/native_extension_bindings_system.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "content/public/common/console_message_level.h" 9 #include "content/public/common/console_message_level.h"
10 #include "content/public/common/content_switches.h" 10 #include "content/public/common/content_switches.h"
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 api_system_( 356 api_system_(
357 base::Bind(&CallJsFunction), 357 base::Bind(&CallJsFunction),
358 base::Bind(&CallJsFunctionSync), 358 base::Bind(&CallJsFunctionSync),
359 base::Bind(&GetAPISchema), 359 base::Bind(&GetAPISchema),
360 base::Bind(&IsAPIFeatureAvailable), 360 base::Bind(&IsAPIFeatureAvailable),
361 base::Bind(&NativeExtensionBindingsSystem::SendRequest, 361 base::Bind(&NativeExtensionBindingsSystem::SendRequest,
362 base::Unretained(this)), 362 base::Unretained(this)),
363 base::Bind(&NativeExtensionBindingsSystem::OnEventListenerChanged, 363 base::Bind(&NativeExtensionBindingsSystem::OnEventListenerChanged,
364 base::Unretained(this)), 364 base::Unretained(this)),
365 base::Bind(&APIActivityLogger::LogAPICall), 365 base::Bind(&APIActivityLogger::LogAPICall),
366 base::Bind(&AddConsoleError),
366 APILastError(base::Bind(&GetLastErrorParents), 367 APILastError(base::Bind(&GetLastErrorParents),
367 base::Bind(&AddConsoleError))), 368 base::Bind(&AddConsoleError))),
368 weak_factory_(this) { 369 weak_factory_(this) {
369 api_system_.RegisterCustomType("storage.StorageArea", 370 api_system_.RegisterCustomType("storage.StorageArea",
370 base::Bind(&StorageArea::CreateStorageArea)); 371 base::Bind(&StorageArea::CreateStorageArea));
371 api_system_.RegisterCustomType("types.ChromeSetting", 372 api_system_.RegisterCustomType("types.ChromeSetting",
372 base::Bind(&ChromeSetting::Create)); 373 base::Bind(&ChromeSetting::Create));
373 api_system_.RegisterCustomType( 374 api_system_.RegisterCustomType(
374 "contentSettings.ContentSetting", 375 "contentSettings.ContentSetting",
375 base::Bind(&ContentSetting::Create, base::Bind(&CallJsFunction))); 376 base::Bind(&ContentSetting::Create, base::Bind(&CallJsFunction)));
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 v8::Local<v8::Value>* binding_util_out) { 705 v8::Local<v8::Value>* binding_util_out) {
705 gin::Handle<APIBindingJSUtil> handle = gin::CreateHandle( 706 gin::Handle<APIBindingJSUtil> handle = gin::CreateHandle(
706 context->GetIsolate(), 707 context->GetIsolate(),
707 new APIBindingJSUtil( 708 new APIBindingJSUtil(
708 api_system_.type_reference_map(), api_system_.request_handler(), 709 api_system_.type_reference_map(), api_system_.request_handler(),
709 api_system_.event_handler(), base::Bind(&CallJsFunction))); 710 api_system_.event_handler(), base::Bind(&CallJsFunction)));
710 *binding_util_out = handle.ToV8(); 711 *binding_util_out = handle.ToV8();
711 } 712 }
712 713
713 } // namespace extensions 714 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/bindings/exception_handler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698