Title: [129020] trunk/Source
Revision
129020
Author
[email protected]
Date
2012-09-19 10:53:48 -0700 (Wed, 19 Sep 2012)

Log Message

[Chromium] Move notifyJSOutOfMemory out of PlatformSupport
https://bugs.webkit.org/show_bug.cgi?id=97116

Reviewed by Adam Barth.

Source/WebCore:

Part of a refactoring series. See tracking bug 82948.

* bindings/v8/V8Binding.cpp:
(WebCore::handleOutOfMemory):
* loader/FrameLoaderClient.h:
(WebCore::FrameLoaderClient::didExhaustMemoryAvailableForScript):
(FrameLoaderClient):
* platform/chromium/PlatformSupport.h:
(PlatformSupport):

Source/WebKit/chromium:

Part of a refactoring series. See tracking bug 82948.

* src/FrameLoaderClientImpl.cpp:
(WebKit::FrameLoaderClientImpl::didExhaustMemoryAvailableForScript):
(WebKit):
* src/FrameLoaderClientImpl.h:
(FrameLoaderClientImpl):
* src/PlatformSupport.cpp:
(WebCore):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (129019 => 129020)


--- trunk/Source/WebCore/ChangeLog	2012-09-19 17:52:14 UTC (rev 129019)
+++ trunk/Source/WebCore/ChangeLog	2012-09-19 17:53:48 UTC (rev 129020)
@@ -1,3 +1,20 @@
+2012-09-19  Mark Pilgrim  <[email protected]>
+
+        [Chromium] Move notifyJSOutOfMemory out of PlatformSupport
+        https://bugs.webkit.org/show_bug.cgi?id=97116
+
+        Reviewed by Adam Barth.
+
+        Part of a refactoring series. See tracking bug 82948.
+
+        * bindings/v8/V8Binding.cpp:
+        (WebCore::handleOutOfMemory):
+        * loader/FrameLoaderClient.h:
+        (WebCore::FrameLoaderClient::didExhaustMemoryAvailableForScript):
+        (FrameLoaderClient):
+        * platform/chromium/PlatformSupport.h:
+        (PlatformSupport):
+
 2012-09-18  Dirk Schulze  <[email protected]>
 
         Implement 'mask-type' for <mask>

Modified: trunk/Source/WebCore/bindings/v8/V8Binding.cpp (129019 => 129020)


--- trunk/Source/WebCore/bindings/v8/V8Binding.cpp	2012-09-19 17:52:14 UTC (rev 129019)
+++ trunk/Source/WebCore/bindings/v8/V8Binding.cpp	2012-09-19 17:53:48 UTC (rev 129020)
@@ -35,7 +35,8 @@
 #include "DOMStringList.h"
 #include "Element.h"
 #include "Frame.h"
-#include "PlatformSupport.h"
+#include "FrameLoader.h"
+#include "FrameLoaderClient.h"
 #include "QualifiedName.h"
 #include "Settings.h"
 #include "V8DOMStringList.h"
@@ -332,7 +333,7 @@
     frame->script()->windowShell()->destroyGlobal();
 
 #if PLATFORM(CHROMIUM)
-    PlatformSupport::notifyJSOutOfMemory(frame);
+    frame->loader()->client()->didExhaustMemoryAvailableForScript();
 #endif
 
     if (Settings* settings = frame->settings())

Modified: trunk/Source/WebCore/loader/FrameLoaderClient.h (129019 => 129020)


--- trunk/Source/WebCore/loader/FrameLoaderClient.h	2012-09-19 17:52:14 UTC (rev 129019)
+++ trunk/Source/WebCore/loader/FrameLoaderClient.h	2012-09-19 17:53:48 UTC (rev 129020)
@@ -278,6 +278,8 @@
         virtual void documentElementAvailable() = 0;
         virtual void didPerformFirstNavigation() const = 0; // "Navigation" here means a transition from one page to another that ends up in the back/forward list.
 
+        virtual void didExhaustMemoryAvailableForScript() { };
+
 #if USE(V8)
         virtual void didCreateScriptContext(v8::Handle<v8::Context>, int extensionGroup, int worldId) = 0;
         virtual void willReleaseScriptContext(v8::Handle<v8::Context>, int worldId) = 0;

Modified: trunk/Source/WebCore/platform/chromium/PlatformSupport.h (129019 => 129020)


--- trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-09-19 17:52:14 UTC (rev 129019)
+++ trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-09-19 17:53:48 UTC (rev 129020)
@@ -113,9 +113,6 @@
     // IndexedDB ----------------------------------------------------------
     static PassRefPtr<IDBFactoryBackendInterface> idbFactory();
 
-    // _javascript_ ---------------------------------------------------------
-    static void notifyJSOutOfMemory(Frame*);
-
     // Plugin -------------------------------------------------------------
     static bool plugins(bool refresh, Vector<PluginInfo>*);
     static NPObject* pluginScriptableObject(Widget*);

Modified: trunk/Source/WebKit/chromium/ChangeLog (129019 => 129020)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-09-19 17:52:14 UTC (rev 129019)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-09-19 17:53:48 UTC (rev 129020)
@@ -1,5 +1,22 @@
 2012-09-19  Mark Pilgrim  <[email protected]>
 
+        [Chromium] Move notifyJSOutOfMemory out of PlatformSupport
+        https://bugs.webkit.org/show_bug.cgi?id=97116
+
+        Reviewed by Adam Barth.
+
+        Part of a refactoring series. See tracking bug 82948.
+        
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::didExhaustMemoryAvailableForScript):
+        (WebKit):
+        * src/FrameLoaderClientImpl.h:
+        (FrameLoaderClientImpl):
+        * src/PlatformSupport.cpp:
+        (WebCore):
+
+2012-09-19  Mark Pilgrim  <[email protected]>
+
         [Chromium] Remove unused popupsAllowed function from PlatformSupport
         https://bugs.webkit.org/show_bug.cgi?id=96521
 

Modified: trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp (129019 => 129020)


--- trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp	2012-09-19 17:52:14 UTC (rev 129019)
+++ trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp	2012-09-19 17:53:48 UTC (rev 129020)
@@ -142,6 +142,12 @@
         m_webFrame->client()->didCreateDocumentElement(m_webFrame);
 }
 
+void FrameLoaderClientImpl::didExhaustMemoryAvailableForScript()
+{
+    if (m_webFrame->client())
+        m_webFrame->client()->didExhaustMemoryAvailableForScript(m_webFrame);
+}
+
 #if USE(V8)
 void FrameLoaderClientImpl::didCreateScriptContext(v8::Handle<v8::Context> context, int extensionGroup, int worldId)
 {

Modified: trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.h (129019 => 129020)


--- trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.h	2012-09-19 17:52:14 UTC (rev 129019)
+++ trunk/Source/WebKit/chromium/src/FrameLoaderClientImpl.h	2012-09-19 17:53:48 UTC (rev 129020)
@@ -61,6 +61,9 @@
     virtual void dispatchDidClearWindowObjectInWorld(WebCore::DOMWrapperWorld*);
     virtual void documentElementAvailable();
 
+    // Script in the page tried to allocate too much memory.
+    virtual void didExhaustMemoryAvailableForScript();
+
 #if USE(V8)
     virtual void didCreateScriptContext(v8::Handle<v8::Context>, int extensionGroup, int worldId);
     virtual void willReleaseScriptContext(v8::Handle<v8::Context>, int worldId);

Modified: trunk/Source/WebKit/chromium/src/PlatformSupport.cpp (129019 => 129020)


--- trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-09-19 17:52:14 UTC (rev 129019)
+++ trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-09-19 17:53:48 UTC (rev 129020)
@@ -499,17 +499,6 @@
 // Glue layer. Once the Glue layer moves entirely into the WebKit layer, these
 // methods will be deleted.
 
-void PlatformSupport::notifyJSOutOfMemory(Frame* frame)
-{
-    if (!frame)
-        return;
-
-    WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame);
-    if (!webFrame->client())
-        return;
-    webFrame->client()->didExhaustMemoryAvailableForScript(webFrame);
-}
-
 int PlatformSupport::screenHorizontalDPI(Widget* widget)
 {
     WebWidgetClient* client = toWebWidgetClient(widget);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to