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

Unified Diff: Source/web/WebBindings.cpp

Issue 23788005: Remove calls to HandleScope default ctor. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: code review (pfeldman) Created 7 years, 3 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 | « Source/web/InspectorFrontendClientImpl.cpp ('k') | Source/web/WebDevToolsFrontendImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebBindings.cpp
diff --git a/Source/web/WebBindings.cpp b/Source/web/WebBindings.cpp
index 664b8d720f5f6cbd7a6810b2a408a60176b00668..8bf54b01030433398cd75699d7472f18689eabfd 100644
--- a/Source/web/WebBindings.cpp
+++ b/Source/web/WebBindings.cpp
@@ -311,26 +311,25 @@ static bool getArrayBufferViewImpl(NPObject* object, WebArrayBufferView* arrayBu
return true;
}
-static NPObject* makeIntArrayImpl(const WebVector<int>& data)
+static NPObject* makeIntArrayImpl(const WebVector<int>& data, v8::Isolate* isolate)
{
- v8::HandleScope handleScope;
+ v8::HandleScope handleScope(isolate);
v8::Handle<v8::Array> result = v8::Array::New(data.size());
for (size_t i = 0; i < data.size(); ++i)
result->Set(i, v8::Number::New(data[i]));
- DOMWindow* window = toDOMWindow(v8::Context::GetCurrent());
+ DOMWindow* window = toDOMWindow(isolate->GetCurrentContext());
return npCreateV8ScriptObject(0, result, window);
}
-static NPObject* makeStringArrayImpl(const WebVector<WebString>& data)
+static NPObject* makeStringArrayImpl(const WebVector<WebString>& data, v8::Isolate* isolate)
{
- v8::Isolate* isolate = v8::Isolate::GetCurrent();
- v8::HandleScope handleScope;
+ v8::HandleScope handleScope(isolate);
v8::Handle<v8::Array> result = v8::Array::New(data.size());
for (size_t i = 0; i < data.size(); ++i)
result->Set(i, v8String(data[i], isolate));
- DOMWindow* window = toDOMWindow(v8::Context::GetCurrent());
+ DOMWindow* window = toDOMWindow(isolate->GetCurrentContext());
return npCreateV8ScriptObject(0, result, window);
}
@@ -361,12 +360,12 @@ bool WebBindings::getElement(NPObject* element, WebElement* webElement)
NPObject* WebBindings::makeIntArray(const WebVector<int>& data)
{
- return makeIntArrayImpl(data);
+ return makeIntArrayImpl(data, v8::Isolate::GetCurrent());
}
NPObject* WebBindings::makeStringArray(const WebVector<WebString>& data)
{
- return makeStringArrayImpl(data);
+ return makeStringArrayImpl(data, v8::Isolate::GetCurrent());
}
void WebBindings::pushExceptionHandler(ExceptionHandler handler, void* data)
« no previous file with comments | « Source/web/InspectorFrontendClientImpl.cpp ('k') | Source/web/WebDevToolsFrontendImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698