Changeset 127976 in webkit
- Timestamp:
- Sep 8, 2012 11:48:14 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r127974 r127976 1 2012-09-08 Adam Barth <abarth@webkit.org> 2 3 [V8] unsafeHandleToCurrentWorldContext doesn't need to exist 4 https://bugs.webkit.org/show_bug.cgi?id=96191 5 6 Reviewed by Kentaro Hara. 7 8 Previously, we used this function when instantiating DOM wrappers. Now 9 we get the context from the creationContext, so we don't need access to 10 this unsafe handle. This patch inlines the function into its one other 11 caller. 12 13 * bindings/v8/ScriptController.cpp: 14 (WebCore::ScriptController::currentWorldContext): 15 * bindings/v8/ScriptController.h: 16 (ScriptController): 17 1 18 2012-09-08 Benjamin Poulain <bpoulain@apple.com> 2 19 -
trunk/Source/WebCore/bindings/v8/ScriptController.cpp
r127106 r127976 412 412 } 413 413 414 v8:: Persistent<v8::Context> ScriptController::unsafeHandleToCurrentWorldContext()414 v8::Local<v8::Context> ScriptController::currentWorldContext() 415 415 { 416 416 if (V8IsolatedContext* isolatedContext = V8IsolatedContext::getEntered()) { 417 417 RefPtr<SharedPersistent<v8::Context> > context = isolatedContext->sharedContext(); 418 418 if (m_frame != toFrameIfNotDetached(context->get())) 419 return v8:: Persistent<v8::Context>();420 return context->get();419 return v8::Local<v8::Context>(); 420 return v8::Local<v8::Context>::New(context->get()); 421 421 } 422 422 windowShell()->initializeIfNeeded(); 423 return windowShell()->context(); 424 } 425 426 v8::Local<v8::Context> ScriptController::currentWorldContext() 427 { 428 return v8::Local<v8::Context>::New(unsafeHandleToCurrentWorldContext()); 423 return v8::Local<v8::Context>::New(windowShell()->context()); 429 424 } 430 425 -
trunk/Source/WebCore/bindings/v8/ScriptController.h
r127106 r127976 173 173 v8::Local<v8::Context> currentWorldContext(); 174 174 175 // WARNING! The handle returned by this function might be Disposed() when JavaScript is executed.176 v8::Persistent<v8::Context> unsafeHandleToCurrentWorldContext();177 178 175 // Pass command-line flags to the JS engine. 179 176 static void setFlags(const char* string, int length);
Note: See TracChangeset
for help on using the changeset viewer.