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

Unified Diff: chrome/renderer/extensions/module_system_unittest.cc

Issue 12313142: Revert 184837 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/extensions/module_system.cc ('k') | chrome/renderer/extensions/native_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/module_system_unittest.cc
===================================================================
--- chrome/renderer/extensions/module_system_unittest.cc (revision 184858)
+++ chrome/renderer/extensions/module_system_unittest.cc (working copy)
@@ -6,15 +6,13 @@
#include "base/memory/scoped_ptr.h"
#include "chrome/renderer/extensions/module_system.h"
-// TODO(cduvall/kalman): Put this file in extensions namespace.
using extensions::ModuleSystem;
using extensions::NativeHandler;
-using extensions::ObjectBackedNativeHandler;
-class CounterNatives : public ObjectBackedNativeHandler {
+class CounterNatives : public NativeHandler {
public:
- explicit CounterNatives(v8::Handle<v8::Context> context)
- : ObjectBackedNativeHandler(context), counter_(0) {
+ explicit CounterNatives(v8::Isolate* isolate)
+ : NativeHandler(isolate), counter_(0) {
RouteFunction("Get", base::Bind(&CounterNatives::Get,
base::Unretained(this)));
RouteFunction("Increment", base::Bind(&CounterNatives::Increment,
@@ -175,7 +173,7 @@
ModuleSystem::NativesEnabledScope natives_enabled_scope(module_system_.get());
module_system_->RegisterNativeHandler(
"counter",
- scoped_ptr<NativeHandler>(new CounterNatives(v8::Context::GetCurrent())));
+ scoped_ptr<NativeHandler>(new CounterNatives(v8::Isolate::GetCurrent())));
RegisterModule("lazy",
"requireNative('counter').Increment();"
"exports.x = 5;");
@@ -229,7 +227,7 @@
ModuleSystem::NativesEnabledScope natives_enabled_scope(module_system_.get());
module_system_->RegisterNativeHandler(
"counter",
- scoped_ptr<NativeHandler>(new CounterNatives(v8::Context::GetCurrent())));
+ scoped_ptr<NativeHandler>(new CounterNatives(v8::Isolate::GetCurrent())));
RegisterModule("incrementsWhenEvaled",
"requireNative('counter').Increment();");
« no previous file with comments | « chrome/renderer/extensions/module_system.cc ('k') | chrome/renderer/extensions/native_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698