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

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

Issue 12517011: Added activity logging for ext APIs with custom bindings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added an earlier check for the IPC communication Created 7 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/dispatcher.h" 5 #include "chrome/renderer/extensions/dispatcher.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/string_piece.h" 10 #include "base/string_piece.h"
11 #include "base/strings/string_split.h" 11 #include "base/strings/string_split.h"
12 #include "chrome/common/child_process_logging.h" 12 #include "chrome/common/child_process_logging.h"
13 #include "chrome/common/chrome_switches.h" 13 #include "chrome/common/chrome_switches.h"
14 #include "chrome/common/chrome_version_info.h" 14 #include "chrome/common/chrome_version_info.h"
15 #include "chrome/common/extensions/api/extension_api.h" 15 #include "chrome/common/extensions/api/extension_api.h"
16 #include "chrome/common/extensions/background_info.h" 16 #include "chrome/common/extensions/background_info.h"
17 #include "chrome/common/extensions/extension.h" 17 #include "chrome/common/extensions/extension.h"
18 #include "chrome/common/extensions/extension_messages.h" 18 #include "chrome/common/extensions/extension_messages.h"
19 #include "chrome/common/extensions/features/feature.h" 19 #include "chrome/common/extensions/features/feature.h"
20 #include "chrome/common/extensions/manifest.h" 20 #include "chrome/common/extensions/manifest.h"
21 #include "chrome/common/extensions/message_bundle.h" 21 #include "chrome/common/extensions/message_bundle.h"
22 #include "chrome/common/extensions/permissions/permission_set.h" 22 #include "chrome/common/extensions/permissions/permission_set.h"
23 #include "chrome/common/url_constants.h" 23 #include "chrome/common/url_constants.h"
24 #include "chrome/common/view_type.h" 24 #include "chrome/common/view_type.h"
25 #include "chrome/renderer/chrome_render_process_observer.h" 25 #include "chrome/renderer/chrome_render_process_observer.h"
26 #include "chrome/renderer/extensions/api_activity_logger.h"
26 #include "chrome/renderer/extensions/api_definitions_natives.h" 27 #include "chrome/renderer/extensions/api_definitions_natives.h"
27 #include "chrome/renderer/extensions/app_bindings.h" 28 #include "chrome/renderer/extensions/app_bindings.h"
28 #include "chrome/renderer/extensions/app_runtime_custom_bindings.h" 29 #include "chrome/renderer/extensions/app_runtime_custom_bindings.h"
29 #include "chrome/renderer/extensions/app_window_custom_bindings.h" 30 #include "chrome/renderer/extensions/app_window_custom_bindings.h"
30 #include "chrome/renderer/extensions/binding_generating_native_handler.h" 31 #include "chrome/renderer/extensions/binding_generating_native_handler.h"
31 #include "chrome/renderer/extensions/chrome_v8_context.h" 32 #include "chrome/renderer/extensions/chrome_v8_context.h"
32 #include "chrome/renderer/extensions/chrome_v8_extension.h" 33 #include "chrome/renderer/extensions/chrome_v8_extension.h"
33 #include "chrome/renderer/extensions/content_watcher.h" 34 #include "chrome/renderer/extensions/content_watcher.h"
34 #include "chrome/renderer/extensions/context_menus_custom_bindings.h" 35 #include "chrome/renderer/extensions/context_menus_custom_bindings.h"
35 #include "chrome/renderer/extensions/dom_activity_logger.h" 36 #include "chrome/renderer/extensions/dom_activity_logger.h"
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 scoped_ptr<NativeHandler>(new ApiDefinitionsNatives(this, context))); 704 scoped_ptr<NativeHandler>(new ApiDefinitionsNatives(this, context)));
704 module_system->RegisterNativeHandler("sendRequest", 705 module_system->RegisterNativeHandler("sendRequest",
705 scoped_ptr<NativeHandler>( 706 scoped_ptr<NativeHandler>(
706 new SendRequestNatives(this, request_sender_.get(), context))); 707 new SendRequestNatives(this, request_sender_.get(), context)));
707 module_system->RegisterNativeHandler("setIcon", 708 module_system->RegisterNativeHandler("setIcon",
708 scoped_ptr<NativeHandler>( 709 scoped_ptr<NativeHandler>(
709 new SetIconNatives(this, request_sender_.get(), context))); 710 new SetIconNatives(this, request_sender_.get(), context)));
710 module_system->RegisterNativeHandler( 711 module_system->RegisterNativeHandler(
711 "contentWatcherNative", 712 "contentWatcherNative",
712 content_watcher_->MakeNatives(v8_context)); 713 content_watcher_->MakeNatives(v8_context));
714 module_system->RegisterNativeHandler("activityLogger",
715 scoped_ptr<NativeHandler>(new APIActivityLogger(this, v8_context)));
713 716
714 // Natives used by multiple APIs. 717 // Natives used by multiple APIs.
715 module_system->RegisterNativeHandler("file_system_natives", 718 module_system->RegisterNativeHandler("file_system_natives",
716 scoped_ptr<NativeHandler>(new FileSystemNatives(v8_context))); 719 scoped_ptr<NativeHandler>(new FileSystemNatives(v8_context)));
717 720
718 // Custom bindings. 721 // Custom bindings.
719 module_system->RegisterNativeHandler("app", 722 module_system->RegisterNativeHandler("app",
720 scoped_ptr<NativeHandler>(new AppBindings(this, context))); 723 scoped_ptr<NativeHandler>(new AppBindings(this, context)));
721 module_system->RegisterNativeHandler("app_runtime", 724 module_system->RegisterNativeHandler("app_runtime",
722 scoped_ptr<NativeHandler>( 725 scoped_ptr<NativeHandler>(
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); 1324 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str());
1322 v8::ThrowException( 1325 v8::ThrowException(
1323 v8::Exception::Error(v8::String::New(error_msg.c_str()))); 1326 v8::Exception::Error(v8::String::New(error_msg.c_str())));
1324 return false; 1327 return false;
1325 } 1328 }
1326 1329
1327 return true; 1330 return true;
1328 } 1331 }
1329 1332
1330 } // namespace extensions 1333 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698