Title: [115219] trunk/Source
Revision
115219
Author
pilg...@chromium.org
Date
2012-04-25 09:16:15 -0700 (Wed, 25 Apr 2012)

Log Message

[Chromium] Call actualMemoryUsageMB directly
https://bugs.webkit.org/show_bug.cgi?id=84837

Reviewed by Kentaro Hara.

Part of a refactoring series. See tracking bug 82948.

Source/WebCore:

* bindings/v8/V8DOMWindowShell.cpp:
(WebCore::reportFatalErrorInV8):
* bindings/v8/V8GCController.cpp:
(WebCore):
* platform/MemoryUsageSupport.cpp:
(WebCore::MemoryUsageSupport::actualMemoryUsageMB):
(WebCore):
* platform/MemoryUsageSupport.h:
(MemoryUsageSupport):
* platform/chromium/MemoryUsageSupportChromium.cpp:
(WebCore::MemoryUsageSupport::actualMemoryUsageMB):
(WebCore):
* platform/chromium/PlatformSupport.h:
(PlatformSupport):

Source/WebKit/chromium:

* src/PlatformSupport.cpp:
(WebCore):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (115218 => 115219)


--- trunk/Source/WebCore/ChangeLog	2012-04-25 16:12:07 UTC (rev 115218)
+++ trunk/Source/WebCore/ChangeLog	2012-04-25 16:16:15 UTC (rev 115219)
@@ -1,3 +1,27 @@
+2012-04-25  Mark Pilgrim  <pilg...@chromium.org>
+
+        [Chromium] Call actualMemoryUsageMB directly
+        https://bugs.webkit.org/show_bug.cgi?id=84837
+
+        Reviewed by Kentaro Hara.
+
+        Part of a refactoring series. See tracking bug 82948.
+
+        * bindings/v8/V8DOMWindowShell.cpp:
+        (WebCore::reportFatalErrorInV8):
+        * bindings/v8/V8GCController.cpp:
+        (WebCore):
+        * platform/MemoryUsageSupport.cpp:
+        (WebCore::MemoryUsageSupport::actualMemoryUsageMB):
+        (WebCore):
+        * platform/MemoryUsageSupport.h:
+        (MemoryUsageSupport):
+        * platform/chromium/MemoryUsageSupportChromium.cpp:
+        (WebCore::MemoryUsageSupport::actualMemoryUsageMB):
+        (WebCore):
+        * platform/chromium/PlatformSupport.h:
+        (PlatformSupport):
+
 2012-04-25  Alexis Menard  <alexis.men...@openbossa.org>
 
         Rename CSSStyleSelector files to StyleResolver.

Modified: trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp (115218 => 115219)


--- trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2012-04-25 16:12:07 UTC (rev 115218)
+++ trunk/Source/WebCore/bindings/v8/V8DOMWindowShell.cpp	2012-04-25 16:16:15 UTC (rev 115219)
@@ -36,6 +36,7 @@
 #include "DocumentLoader.h"
 #include "Frame.h"
 #include "FrameLoaderClient.h"
+#include "MemoryUsageSupport.h"
 #include "Page.h"
 #include "PageGroup.h"
 #include "RuntimeEnabledFeatures.h"
@@ -94,7 +95,7 @@
     // FIXME: clean up V8Proxy and disable _javascript_.
     int memoryUsageMB = -1;
 #if PLATFORM(CHROMIUM)
-    memoryUsageMB = PlatformSupport::actualMemoryUsageMB();
+    memoryUsageMB = MemoryUsageSupport::actualMemoryUsageMB();
 #endif
     printf("V8 error: %s (%s).  Current memory usage: %d MB\n", message, location, memoryUsageMB);
     handleFatalErrorInV8();

Modified: trunk/Source/WebCore/bindings/v8/V8GCController.cpp (115218 => 115219)


--- trunk/Source/WebCore/bindings/v8/V8GCController.cpp	2012-04-25 16:12:07 UTC (rev 115218)
+++ trunk/Source/WebCore/bindings/v8/V8GCController.cpp	2012-04-25 16:16:15 UTC (rev 115219)
@@ -478,7 +478,7 @@
 int getActualMemoryUsageInMB()
 {
 #if PLATFORM(CHROMIUM)
-    return PlatformSupport::actualMemoryUsageMB();
+    return MemoryUsageSupport::actualMemoryUsageMB();
 #else
     return 0;
 #endif

Modified: trunk/Source/WebCore/platform/MemoryUsageSupport.cpp (115218 => 115219)


--- trunk/Source/WebCore/platform/MemoryUsageSupport.cpp	2012-04-25 16:12:07 UTC (rev 115218)
+++ trunk/Source/WebCore/platform/MemoryUsageSupport.cpp	2012-04-25 16:16:15 UTC (rev 115219)
@@ -38,4 +38,9 @@
     return 0;
 }
 
+int MemoryUsageSupport::actualMemoryUsageMB()
+{
+    return 0;
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/MemoryUsageSupport.h (115218 => 115219)


--- trunk/Source/WebCore/platform/MemoryUsageSupport.h	2012-04-25 16:12:07 UTC (rev 115218)
+++ trunk/Source/WebCore/platform/MemoryUsageSupport.h	2012-04-25 16:16:15 UTC (rev 115219)
@@ -38,6 +38,10 @@
     // Returns the current space allocated for the pagefile, in MB.
     // That is committed size for Windows and virtual memory size for POSIX.
     static int memoryUsageMB();
+
+    // Same as above, but always returns actual value, without any
+    // caches.
+    static int actualMemoryUsageMB();
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/chromium/MemoryUsageSupportChromium.cpp (115218 => 115219)


--- trunk/Source/WebCore/platform/chromium/MemoryUsageSupportChromium.cpp	2012-04-25 16:12:07 UTC (rev 115218)
+++ trunk/Source/WebCore/platform/chromium/MemoryUsageSupportChromium.cpp	2012-04-25 16:16:15 UTC (rev 115219)
@@ -40,4 +40,9 @@
     return WebKit::Platform::current()->memoryUsageMB();
 }
 
+int MemoryUsageSupport::actualMemoryUsageMB()
+{
+    return WebKit::Platform::current()->actualMemoryUsageMB();
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/chromium/PlatformSupport.h (115218 => 115219)


--- trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-04-25 16:12:07 UTC (rev 115218)
+++ trunk/Source/WebCore/platform/chromium/PlatformSupport.h	2012-04-25 16:16:15 UTC (rev 115219)
@@ -195,8 +195,6 @@
     static bool layoutTestMode();
 
     // Memory -------------------------------------------------------------
-    // Same as above, but always returns actual value, without any caches.
-    static int actualMemoryUsageMB();
     // If memory usage is below this threshold, do not bother forcing GC.
     static int lowMemoryUsageMB();
     // If memory usage is above this threshold, force GC more aggressively.

Modified: trunk/Source/WebKit/chromium/ChangeLog (115218 => 115219)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-04-25 16:12:07 UTC (rev 115218)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-04-25 16:16:15 UTC (rev 115219)
@@ -1,3 +1,15 @@
+2012-04-25  Mark Pilgrim  <pilg...@chromium.org>
+
+        [Chromium] Call actualMemoryUsageMB directly
+        https://bugs.webkit.org/show_bug.cgi?id=84837
+
+        Reviewed by Kentaro Hara.
+
+        Part of a refactoring series. See tracking bug 82948.
+
+        * src/PlatformSupport.cpp:
+        (WebCore):
+
 2012-04-25  Alexis Menard  <alexis.men...@openbossa.org>
 
         Rename CSSStyleSelector files to StyleResolver.

Modified: trunk/Source/WebKit/chromium/src/PlatformSupport.cpp (115218 => 115219)


--- trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-04-25 16:12:07 UTC (rev 115218)
+++ trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-04-25 16:16:15 UTC (rev 115219)
@@ -914,11 +914,6 @@
     webFrame->client()->didExhaustMemoryAvailableForScript(webFrame);
 }
 
-int PlatformSupport::actualMemoryUsageMB()
-{
-    return static_cast<int>(webKitPlatformSupport()->actualMemoryUsageMB());
-}
-
 int PlatformSupport::lowMemoryUsageMB()
 {
     return static_cast<int>(webKitPlatformSupport()->lowMemoryUsageMB());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to