Changeset 126137 in webkit
- Timestamp:
- Aug 20, 2012 11:50:42 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r126136 r126137 1 2012-08-20 Kentaro Hara <haraken@chromium.org> 2 3 [V8] Move handleOutOfMemory() from V8Proxy to V8Binding 4 https://bugs.webkit.org/show_bug.cgi?id=94563 5 6 Reviewed by Adam Barth. 7 8 To kill V8Proxy, this patch moves handleOutOfMemory() from V8Proxy to V8Binding. 9 10 No tests. No change in behavior. 11 12 * bindings/v8/V8AbstractEventListener.cpp: 13 (WebCore::V8AbstractEventListener::invokeEventHandler): 14 * bindings/v8/V8Binding.cpp: 15 (WebCore::handleOutOfMemory): 16 (WebCore): 17 * bindings/v8/V8Binding.h: 18 (WebCore): 19 * bindings/v8/V8Proxy.cpp: 20 * bindings/v8/V8Proxy.h: 21 (V8Proxy): 22 * bindings/v8/WorkerContextExecutionProxy.cpp: 23 (WebCore::WorkerContextExecutionProxy::runScript): 24 1 25 2012-08-20 MORITA Hajime <morrita@google.com> 2 26 -
trunk/Source/WebCore/bindings/v8/V8AbstractEventListener.cpp
r110222 r126137 182 182 DateExtension::get()->setAllowSleep(true); 183 183 184 ASSERT(! V8Proxy::handleOutOfMemory() || returnValue.IsEmpty());184 ASSERT(!handleOutOfMemory() || returnValue.IsEmpty()); 185 185 186 186 if (returnValue.IsEmpty()) -
trunk/Source/WebCore/bindings/v8/V8Binding.cpp
r126103 r126137 39 39 #include "PlatformString.h" 40 40 #include "QualifiedName.h" 41 #include "Settings.h" 41 42 #include "V8DOMStringList.h" 42 43 #include "V8DOMWindow.h" … … 411 412 } 412 413 414 bool handleOutOfMemory() 415 { 416 v8::Local<v8::Context> context = v8::Context::GetCurrent(); 417 418 if (!context->HasOutOfMemoryException()) 419 return false; 420 421 // Warning, error, disable JS for this frame? 422 Frame* frame = toFrameIfNotDetached(context); 423 if (!frame) 424 return true; 425 426 frame->script()->clearForClose(); 427 frame->script()->windowShell()->destroyGlobal(); 428 429 #if PLATFORM(CHROMIUM) 430 PlatformSupport::notifyJSOutOfMemory(frame); 431 #endif 432 433 if (Settings* settings = frame->settings()) 434 settings->setScriptEnabled(false); 435 436 return true; 437 } 438 413 439 void crashIfV8IsDead() 414 440 { -
trunk/Source/WebCore/bindings/v8/V8Binding.h
r126103 r126137 379 379 V8PerContextData* perContextDataForCurrentWorld(Frame*); 380 380 381 // If the current context causes out of memory, JavaScript setting 382 // is disabled and it returns true. 383 bool handleOutOfMemory(); 384 381 385 void crashIfV8IsDead(); 382 386 -
trunk/Source/WebCore/bindings/v8/V8Proxy.cpp
r126109 r126137 133 133 } 134 134 135 bool V8Proxy::handleOutOfMemory()136 {137 v8::Local<v8::Context> context = v8::Context::GetCurrent();138 139 if (!context->HasOutOfMemoryException())140 return false;141 142 // Warning, error, disable JS for this frame?143 Frame* frame = toFrameIfNotDetached(context);144 if (!frame)145 return true;146 147 frame->script()->clearForClose();148 frame->script()->windowShell()->destroyGlobal();149 150 #if PLATFORM(CHROMIUM)151 PlatformSupport::notifyJSOutOfMemory(frame);152 #endif153 154 if (Settings* settings = frame->settings())155 settings->setScriptEnabled(false);156 157 return true;158 }159 160 135 PassOwnPtr<v8::ScriptData> V8Proxy::precompileScript(v8::Handle<v8::String> code, CachedScript* cachedScript) 161 136 { -
trunk/Source/WebCore/bindings/v8/V8Proxy.h
r126109 r126137 105 105 static v8::Local<v8::Context> context(Frame*); 106 106 107 // If the current context causes out of memory, JavaScript setting108 // is disabled and it returns true.109 static bool handleOutOfMemory();110 111 107 static v8::Handle<v8::Script> compileScript(v8::Handle<v8::String> code, const String& fileName, const TextPosition& scriptStartPosition, v8::ScriptData* = 0); 112 108 -
trunk/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp
r125995 r126137 254 254 } 255 255 256 if ( V8Proxy::handleOutOfMemory())256 if (handleOutOfMemory()) 257 257 ASSERT(script.IsEmpty()); 258 258
Note: See TracChangeset
for help on using the changeset viewer.