Changeset 104694 in webkit
- Timestamp:
- Jan 11, 2012 2:58:00 AM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r104690 r104694 1 2012-01-11 Jochen Eisinger <jochen@chromium.org> 2 3 Move the check for canExecuteScripts out of V8Proxy::retrieve 4 https://bugs.webkit.org/show_bug.cgi?id=75533 5 6 Reviewed by Adam Barth. 7 8 This change doesn't move the check to custom/generated bindings for 9 individual objects, as these won't get executed if scripts are disabled 10 anyway. 11 12 No new tests. No functional change. 13 14 * bindings/v8/PageScriptDebugServer.cpp: 15 (WebCore::PageScriptDebugServer::addListener): 16 * bindings/v8/ScheduledAction.cpp: 17 (WebCore::ScheduledAction::execute): 18 * bindings/v8/ScriptCachedFrameData.cpp: 19 (WebCore::ScriptCachedFrameData::restore): 20 * bindings/v8/V8DOMWrapper.cpp: 21 (WebCore::V8DOMWrapper::instantiateV8Object): 22 * bindings/v8/V8EventListener.cpp: 23 (WebCore::V8EventListener::callListenerFunction): 24 * bindings/v8/V8LazyEventListener.cpp: 25 (WebCore::V8LazyEventListener::callListenerFunction): 26 (WebCore::V8LazyEventListener::prepareListenerObject): 27 * bindings/v8/V8Proxy.cpp: 28 (WebCore::V8Proxy::handleOutOfMemory): 29 (WebCore::V8Proxy::retrieve): 30 (WebCore::toV8Context): 31 1 32 2012-01-11 Kentaro Hara <haraken@chromium.org> 2 33 -
trunk/Source/WebCore/bindings/v8/PageScriptDebugServer.cpp
r101156 r104694 77 77 void PageScriptDebugServer::addListener(ScriptDebugListener* listener, Page* page) 78 78 { 79 ScriptController* scriptController = page->mainFrame()->script(); 80 if (!scriptController->canExecuteScripts(NotAboutToExecuteScript)) 81 return; 79 82 V8Proxy* proxy = V8Proxy::retrieve(page->mainFrame()); 80 if (!proxy)81 return;82 83 83 84 v8::HandleScope scope; -
trunk/Source/WebCore/bindings/v8/ScheduledAction.cpp
r95901 r104694 95 95 void ScheduledAction::execute(ScriptExecutionContext* context) 96 96 { 97 V8Proxy* proxy = V8Proxy::retrieve(context); 98 if (proxy) 97 if (context->isDocument()) { 98 Frame* frame = static_cast<Document*>(context)->frame(); 99 ScriptController* scriptController = frame->script(); 100 if (!scriptController->canExecuteScripts(NotAboutToExecuteScript)) 101 return; 102 V8Proxy* proxy = V8Proxy::retrieve(frame); 99 103 execute(proxy); 104 } 100 105 #if ENABLE(WORKERS) 101 else if (context->isWorkerContext()) 106 else { 107 ASSERT(context->isWorkerContext()); 102 108 execute(static_cast<WorkerContext*>(context)); 109 } 103 110 #endif 104 // It's possible that Javascript is disabled and that we have neither a V8Proxy105 // nor a WorkerContext. Do nothing in that case.106 111 } 107 112 -
trunk/Source/WebCore/bindings/v8/ScriptCachedFrameData.cpp
r95901 r104694 60 60 return; 61 61 62 if (!frame->script()->canExecuteScripts(NotAboutToExecuteScript)) 63 return; 64 62 65 v8::HandleScope handleScope; 63 66 v8::Context::Scope contextScope(m_context.get()); -
trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp
r100307 r104694 217 217 if (!context.IsEmpty()) { 218 218 v8::Handle<v8::Object> globalPrototype = v8::Handle<v8::Object>::Cast(context->Global()->GetPrototype()); 219 if (isWrapperOfType(globalPrototype, &V8DOMWindow::info)) 220 proxy = V8Proxy::retrieve(V8DOMWindow::toNative(globalPrototype)->frame()); 219 if (isWrapperOfType(globalPrototype, &V8DOMWindow::info)) { 220 Frame* frame = V8DOMWindow::toNative(globalPrototype)->frame(); 221 if (frame && frame->script()->canExecuteScripts(NotAboutToExecuteScript)) 222 proxy = V8Proxy::retrieve(frame); 223 } 221 224 #if ENABLE(WORKERS) 222 225 else -
trunk/Source/WebCore/bindings/v8/V8EventListener.cpp
r95901 r104694 36 36 #endif 37 37 38 #include "Document.h" 39 #include "Frame.h" 38 40 #include "V8Proxy.h" 39 41 … … 82 84 #endif 83 85 84 if (V8Proxy* proxy = V8Proxy::retrieve(context)) 85 return proxy->callFunction(handlerFunction, receiver, 1, parameters); 86 if (V8Proxy* proxy = V8Proxy::retrieve(context)) { 87 Frame* frame = static_cast<Document*>(context)->frame(); 88 if (frame->script()->canExecuteScripts(NotAboutToExecuteScript)) 89 return proxy->callFunction(handlerFunction, receiver, 1, parameters); 90 } 86 91 87 92 return v8::Local<v8::Value>(); -
trunk/Source/WebCore/bindings/v8/V8LazyEventListener.cpp
r102424 r104694 66 66 v8::Handle<v8::Value> parameters[1] = { jsEvent }; 67 67 68 if (V8Proxy* proxy = V8Proxy::retrieve(context)) 69 return proxy->callFunction(handlerFunction, receiver, 1, parameters); 68 if (V8Proxy* proxy = V8Proxy::retrieve(context)) { 69 Frame* frame = static_cast<Document*>(context)->frame(); 70 if (frame->script()->canExecuteScripts(NotAboutToExecuteScript)) 71 return proxy->callFunction(handlerFunction, receiver, 1, parameters); 72 } 70 73 71 74 return v8::Local<v8::Value>(); … … 89 92 V8Proxy* proxy = V8Proxy::retrieve(context); 90 93 if (!proxy) 94 return; 95 ASSERT(context->isDocument()); 96 if (!static_cast<Document*>(context)->frame()->script()->canExecuteScripts(NotAboutToExecuteScript)) 91 97 return; 92 98 -
trunk/Source/WebCore/bindings/v8/V8Proxy.cpp
r102871 r104694 191 191 192 192 V8Proxy* proxy = V8Proxy::retrieve(frame); 193 if (proxy ) {193 if (proxy && frame->script()->canExecuteScripts(NotAboutToExecuteScript)) { 194 194 // Clean m_context, and event handlers. 195 195 proxy->clearForClose(); … … 506 506 V8Proxy* V8Proxy::retrieve(Frame* frame) 507 507 { 508 if (!frame) 509 return 0; 510 return frame->script()->canExecuteScripts(NotAboutToExecuteScript) ? frame->script()->proxy() : 0; 508 return frame ? frame->script()->proxy() : 0; 511 509 } 512 510 … … 709 707 { 710 708 if (context->isDocument()) { 711 if (V8Proxy* proxy = V8Proxy::retrieve(context)) 712 return worldContext.adjustedContext(proxy); 709 if (V8Proxy* proxy = V8Proxy::retrieve(context)) { 710 Frame* frame = static_cast<Document*>(context)->frame(); 711 if (frame->script()->canExecuteScripts(NotAboutToExecuteScript)) 712 return worldContext.adjustedContext(proxy); 713 } 713 714 #if ENABLE(WORKERS) 714 715 } else if (context->isWorkerContext()) { -
trunk/Source/WebKit/chromium/ChangeLog
r104650 r104694 1 2012-01-11 Jochen Eisinger <jochen@chromium.org> 2 3 Move the check for canExecuteScripts out of V8Proxy::retrieve 4 https://bugs.webkit.org/show_bug.cgi?id=75533 5 6 Reviewed by Adam Barth. 7 8 * src/WebDevToolsAgentImpl.cpp: 9 (WebKit::WebDevToolsAgentImpl::didClearWindowObject): 10 1 11 2012-01-10 Daniel Cheng <dcheng@chromium.org> 2 12 -
trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp
r102620 r104694 228 228 { 229 229 WebCore::V8Proxy* proxy = WebCore::V8Proxy::retrieve(webframe->frame()); 230 if (proxy )230 if (proxy && webframe->frame()->script()->canExecuteScripts(NotAboutToExecuteScript)) 231 231 proxy->setContextDebugId(m_hostId); 232 232 }
Note: See TracChangeset
for help on using the changeset viewer.