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

Unified Diff: Source/bindings/v8/V8Initializer.cpp

Issue 209713003: Make DOMWrapperWorld::current() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/v8/V8ErrorHandler.cpp ('k') | Source/bindings/v8/V8MutationCallback.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8Initializer.cpp
diff --git a/Source/bindings/v8/V8Initializer.cpp b/Source/bindings/v8/V8Initializer.cpp
index 98dce3b8fc1fd36669dcce3b4cae9029b16d528b..1cd02627b1ad467f5ba56a3ce2f0429a1a2ec8c3 100644
--- a/Source/bindings/v8/V8Initializer.cpp
+++ b/Source/bindings/v8/V8Initializer.cpp
@@ -111,8 +111,8 @@ static void messageHandlerInMainThread(v8::Handle<v8::Message> message, v8::Hand
String resource = shouldUseDocumentURL ? enteredWindow->document()->url() : toCoreString(resourceName.As<v8::String>());
AccessControlStatus corsStatus = message->IsSharedCrossOrigin() ? SharableCrossOrigin : NotSharableCrossOrigin;
- DOMWrapperWorld* world = DOMWrapperWorld::current(isolate);
- RefPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, resource, message->GetLineNumber(), message->GetStartColumn() + 1, world);
+ DOMWrapperWorld& world = DOMWrapperWorld::current(isolate);
+ RefPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, resource, message->GetLineNumber(), message->GetStartColumn() + 1, &world);
if (V8DOMWrapper::isDOMWrapper(data)) {
v8::Handle<v8::Object> obj = v8::Handle<v8::Object>::Cast(data);
const WrapperTypeInfo* type = toWrapperTypeInfo(obj);
@@ -127,7 +127,7 @@ static void messageHandlerInMainThread(v8::Handle<v8::Message> message, v8::Hand
// avoid storing the exception object, as we can't create a wrapper during context creation.
// FIXME: Can we even get here during initialization now that we bail out when GetEntered returns an empty handle?
LocalFrame* frame = enteredWindow->document()->frame();
- if (world && frame && frame->script().existingWindowShell(world))
+ if (frame && frame->script().existingWindowShell(world))
V8ErrorHandler::storeExceptionOnErrorEventWrapper(event.get(), data, v8::Isolate::GetCurrent());
enteredWindow->document()->reportException(event.release(), callStack, corsStatus);
}
@@ -219,7 +219,7 @@ static void messageHandlerInWorker(v8::Handle<v8::Message> message, v8::Handle<v
String errorMessage = toCoreString(message->Get());
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, sourceURL, message->GetScriptResourceName());
- RefPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, sourceURL, message->GetLineNumber(), message->GetStartColumn() + 1, DOMWrapperWorld::current(isolate));
+ RefPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, sourceURL, message->GetLineNumber(), message->GetStartColumn() + 1, &DOMWrapperWorld::current(isolate));
AccessControlStatus corsStatus = message->IsSharedCrossOrigin() ? SharableCrossOrigin : NotSharableCrossOrigin;
V8ErrorHandler::storeExceptionOnErrorEventWrapper(event.get(), data, isolate);
« no previous file with comments | « Source/bindings/v8/V8ErrorHandler.cpp ('k') | Source/bindings/v8/V8MutationCallback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698