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

Unified Diff: chrome/test/base/module_system_test.cc

Issue 16032015: Extensions: pass ChromeV8Context around instead of v8::Handle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review (kalman) Created 7 years, 7 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
Index: chrome/test/base/module_system_test.cc
diff --git a/chrome/test/base/module_system_test.cc b/chrome/test/base/module_system_test.cc
index 56024269e7736c3e23ca20ea7ce0c9898aeeaf90..f91328b0ae13baa6ecf38d9de5b165f24404264d 100644
--- a/chrome/test/base/module_system_test.cc
+++ b/chrome/test/base/module_system_test.cc
@@ -20,7 +20,7 @@ using extensions::ObjectBackedNativeHandler;
// Native JS functions for doing asserts.
class AssertNatives : public ObjectBackedNativeHandler {
public:
- explicit AssertNatives(v8::Handle<v8::Context> context)
+ explicit AssertNatives(extensions::ChromeV8Context* context)
: ObjectBackedNativeHandler(context),
assertion_made_(false),
failed_(false) {
@@ -87,12 +87,18 @@ class FailsOnException : public ModuleSystem::ExceptionHandler {
ModuleSystemTest::ModuleSystemTest()
: isolate_(v8::Isolate::GetCurrent()),
handle_scope_(isolate_),
- context_(v8::Context::New(isolate_)),
+ context_(
+ new extensions::ChromeV8Context(
+ v8::Context::New(isolate_),
+ reinterpret_cast<WebKit::WebFrame*>(1),
+ NULL,
+ extensions::Feature::UNSPECIFIED_CONTEXT)),
source_map_(new StringSourceMap()),
should_assertions_be_made_(true) {
- context_->Enter();
+ context_->v8_context()->Enter();
assert_natives_ = new AssertNatives(context_.get());
- module_system_.reset(new ModuleSystem(context_.get(), source_map_.get()));
+ module_system_.reset(
+ new ModuleSystem(context_.get(), source_map_.get()));
module_system_->RegisterNativeHandler("assert", scoped_ptr<NativeHandler>(
assert_natives_));
module_system_->SetExceptionHandlerForTest(
@@ -101,7 +107,7 @@ ModuleSystemTest::ModuleSystemTest()
ModuleSystemTest::~ModuleSystemTest() {
module_system_.reset();
- context_->Exit();
+ context_->v8_context()->Exit();
not at google - send to devlin 2013/05/29 17:41:55 idly wonder why this doesn't hold onto a context s
}
void ModuleSystemTest::RegisterModule(const std::string& name,
« chrome/renderer/extensions/event_bindings.cc ('K') | « chrome/test/base/module_system_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698