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

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

Issue 16032015: Extensions: pass ChromeV8Context around instead of v8::Handle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 6 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include <string> 5 #include <string>
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "chrome/common/extensions/extension_messages.h" 7 #include "chrome/common/extensions/extension_messages.h"
8 #include "chrome/renderer/chrome_render_process_observer.h" 8 #include "chrome/renderer/chrome_render_process_observer.h"
9 #include "chrome/renderer/extensions/api_activity_logger.h" 9 #include "chrome/renderer/extensions/api_activity_logger.h"
10 #include "content/public/renderer/render_thread.h" 10 #include "content/public/renderer/render_thread.h"
11 #include "content/public/renderer/v8_value_converter.h" 11 #include "content/public/renderer/v8_value_converter.h"
12 12
13 using content::V8ValueConverter; 13 using content::V8ValueConverter;
14 14
15 namespace extensions { 15 namespace extensions {
16 16
17 APIActivityLogger::APIActivityLogger( 17 APIActivityLogger::APIActivityLogger(
18 Dispatcher* dispatcher, v8::Handle<v8::Context> v8_context) 18 Dispatcher* dispatcher, ChromeV8Context* context)
19 : ChromeV8Extension(dispatcher, v8_context) { 19 : ChromeV8Extension(dispatcher, context) {
20 RouteFunction("LogEvent", base::Bind(&APIActivityLogger::LogEvent)); 20 RouteFunction("LogEvent", base::Bind(&APIActivityLogger::LogEvent));
21 RouteFunction("LogAPICall", base::Bind(&APIActivityLogger::LogAPICall)); 21 RouteFunction("LogAPICall", base::Bind(&APIActivityLogger::LogAPICall));
22 } 22 }
23 23
24 // static 24 // static
25 v8::Handle<v8::Value> APIActivityLogger::LogAPICall(const v8::Arguments& args) { 25 v8::Handle<v8::Value> APIActivityLogger::LogAPICall(const v8::Arguments& args) {
26 LogInternal(APICALL, args); 26 LogInternal(APICALL, args);
27 return v8::Undefined(); 27 return v8::Undefined();
28 } 28 }
29 29
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // static 74 // static
75 void APIActivityLogger::LogBlockedCall(const std::string& extension_id, 75 void APIActivityLogger::LogBlockedCall(const std::string& extension_id,
76 const std::string& function_name) { 76 const std::string& function_name) {
77 content::RenderThread::Get()->Send( 77 content::RenderThread::Get()->Send(
78 new ExtensionHostMsg_AddBlockedCallToActivityLog(extension_id, 78 new ExtensionHostMsg_AddBlockedCallToActivityLog(extension_id,
79 function_name)); 79 function_name));
80 } 80 }
81 81
82 82
83 } // namespace extensions 83 } // namespace extensions
84
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698