Title: [119068] trunk/Source
Revision
119068
Author
[email protected]
Date
2012-05-31 00:33:16 -0700 (Thu, 31 May 2012)

Log Message

Web Inspector: add MemoryUsageSupport::processMemorySizesInBytes
https://bugs.webkit.org/show_bug.cgi?id=87830

Reviewed by James Robinson.

Source/Platform:

* chromium/public/Platform.h:
(Platform):
(WebKit::Platform::processMemorySizesInBytes): moved this method from
Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h, also
removed 'get' prefix.

Source/WebCore:

Added a method for getting process memory usage in bytes. It is
used in the inspector memory instrumentation to get process total
memory usage.

* inspector/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):
* platform/MemoryUsageSupport.cpp:
(WebCore::MemoryUsageSupport::processMemorySizesInBytes):
(WebCore):
* platform/MemoryUsageSupport.h:
(MemoryUsageSupport): provided embedders with a way to report WebKit process
memory usage.
* platform/chromium/MemoryUsageSupportChromium.cpp:
(WebCore::MemoryUsageSupport::processMemorySizesInBytes):
(WebCore):

Source/WebKit/chromium:

* public/platform/WebKitPlatformSupport.h: pulled getProcessMemorySize up
to the Source/Platform/chromium/public/Platform.h
* src/PlatformSupport.cpp:

Modified Paths

Diff

Modified: trunk/Source/Platform/ChangeLog (119067 => 119068)


--- trunk/Source/Platform/ChangeLog	2012-05-31 07:22:58 UTC (rev 119067)
+++ trunk/Source/Platform/ChangeLog	2012-05-31 07:33:16 UTC (rev 119068)
@@ -1,3 +1,16 @@
+2012-05-30  Yury Semikhatsky  <[email protected]>
+
+        Web Inspector: add MemoryUsageSupport::processMemorySizesInBytes
+        https://bugs.webkit.org/show_bug.cgi?id=87830
+
+        Reviewed by James Robinson.
+
+        * chromium/public/Platform.h:
+        (Platform):
+        (WebKit::Platform::processMemorySizesInBytes): moved this method from
+        Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h, also
+        removed 'get' prefix.
+
 2012-05-29  Mark Pilgrim  <[email protected]>
 
         [Chromium] Move fileExists to Platform.h

Modified: trunk/Source/Platform/chromium/public/Platform.h (119067 => 119068)


--- trunk/Source/Platform/chromium/public/Platform.h	2012-05-31 07:22:58 UTC (rev 119067)
+++ trunk/Source/Platform/chromium/public/Platform.h	2012-05-31 07:33:16 UTC (rev 119068)
@@ -153,6 +153,10 @@
     // Delta of memory usage growth (vs. last actualMemoryUsageMB()) to force GC when memory usage is high.
     virtual size_t highUsageDeltaMB() { return 128; }
 
+    // Returns private and shared usage, in bytes. Private bytes is the amount of
+    // memory currently allocated to this process that cannot be shared. Returns
+    // false on platform specific error conditions.
+    virtual bool processMemorySizesInBytes(size_t* privateBytes, size_t* sharedBytes) { return false; }
 
     // Network -------------------------------------------------------------
 

Modified: trunk/Source/WebCore/ChangeLog (119067 => 119068)


--- trunk/Source/WebCore/ChangeLog	2012-05-31 07:22:58 UTC (rev 119067)
+++ trunk/Source/WebCore/ChangeLog	2012-05-31 07:33:16 UTC (rev 119068)
@@ -1,3 +1,26 @@
+2012-05-30  Yury Semikhatsky  <[email protected]>
+
+        Web Inspector: add MemoryUsageSupport::processMemorySizesInBytes
+        https://bugs.webkit.org/show_bug.cgi?id=87830
+
+        Reviewed by James Robinson.
+
+        Added a method for getting process memory usage in bytes. It is
+        used in the inspector memory instrumentation to get process total
+        memory usage.
+
+        * inspector/InspectorMemoryAgent.cpp:
+        (WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):
+        * platform/MemoryUsageSupport.cpp:
+        (WebCore::MemoryUsageSupport::processMemorySizesInBytes):
+        (WebCore):
+        * platform/MemoryUsageSupport.h:
+        (MemoryUsageSupport): provided embedders with a way to report WebKit process
+        memory usage.
+        * platform/chromium/MemoryUsageSupportChromium.cpp:
+        (WebCore::MemoryUsageSupport::processMemorySizesInBytes):
+        (WebCore):
+
 2012-05-31  Kent Tamura  <[email protected]>
 
         Unreviewed, rolling out r119062 and r119064.

Modified: trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp (119067 => 119068)


--- trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp	2012-05-31 07:22:58 UTC (rev 119067)
+++ trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp	2012-05-31 07:33:16 UTC (rev 119068)
@@ -43,11 +43,9 @@
 #include "InspectorState.h"
 #include "InspectorValues.h"
 #include "InstrumentingAgents.h"
+#include "MemoryUsageSupport.h"
 #include "Node.h"
 #include "Page.h"
-#if PLATFORM(CHROMIUM)
-#include "PlatformSupport.h"
-#endif
 #include "ScriptGCEvent.h"
 #include "ScriptProfiler.h"
 #include "StyledElement.h"
@@ -339,10 +337,8 @@
 void InspectorMemoryAgent::getProcessMemoryDistribution(ErrorString*, RefPtr<WebCore::TypeBuilder::Memory::MemoryBlock>& processMemory)
 {
     size_t privateBytes = 0;
-#if PLATFORM(CHROMIUM)
     size_t sharedBytes = 0;
-    PlatformSupport::getProcessMemorySize(&privateBytes, &sharedBytes);
-#endif
+    MemoryUsageSupport::processMemorySizesInBytes(&privateBytes, &sharedBytes);
     processMemory = WebCore::TypeBuilder::Memory::MemoryBlock::create().setName(MemoryBlockName::processPrivateMemory);
     processMemory->setSize(static_cast<int>(privateBytes));
 

Modified: trunk/Source/WebCore/platform/MemoryUsageSupport.cpp (119067 => 119068)


--- trunk/Source/WebCore/platform/MemoryUsageSupport.cpp	2012-05-31 07:22:58 UTC (rev 119067)
+++ trunk/Source/WebCore/platform/MemoryUsageSupport.cpp	2012-05-31 07:33:16 UTC (rev 119068)
@@ -58,4 +58,9 @@
     return 0;
 }
     
+bool MemoryUsageSupport::processMemorySizesInBytes(size_t*, size_t*)
+{
+    return false;
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/MemoryUsageSupport.h (119067 => 119068)


--- trunk/Source/WebCore/platform/MemoryUsageSupport.h	2012-05-31 07:22:58 UTC (rev 119067)
+++ trunk/Source/WebCore/platform/MemoryUsageSupport.h	2012-05-31 07:33:16 UTC (rev 119068)
@@ -52,6 +52,11 @@
     // Delta of memory usage growth (vs. last actualMemoryUsageMB())
     // to force GC when memory usage is high.
     static int highUsageDeltaMB();
+
+    // Returns private and shared usage, in bytes. Private bytes is the amount of
+    // memory currently allocated to this process that cannot be shared. Returns
+    // false on platform specific error conditions.
+    static bool processMemorySizesInBytes(size_t* privateBytes, size_t* sharedBytes);
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/chromium/MemoryUsageSupportChromium.cpp (119067 => 119068)


--- trunk/Source/WebCore/platform/chromium/MemoryUsageSupportChromium.cpp	2012-05-31 07:22:58 UTC (rev 119067)
+++ trunk/Source/WebCore/platform/chromium/MemoryUsageSupportChromium.cpp	2012-05-31 07:33:16 UTC (rev 119068)
@@ -60,4 +60,9 @@
     return WebKit::Platform::current()->highUsageDeltaMB();
 }
 
+bool MemoryUsageSupport::processMemorySizesInBytes(size_t* privateBytes, size_t* sharedBytes)
+{
+    return WebKit::Platform::current()->processMemorySizesInBytes(privateBytes, sharedBytes);
+}
+
 } // namespace WebCore

Modified: trunk/Source/WebKit/chromium/ChangeLog (119067 => 119068)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-05-31 07:22:58 UTC (rev 119067)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-05-31 07:33:16 UTC (rev 119068)
@@ -1,3 +1,14 @@
+2012-05-30  Yury Semikhatsky  <[email protected]>
+
+        Web Inspector: add MemoryUsageSupport::processMemorySizesInBytes
+        https://bugs.webkit.org/show_bug.cgi?id=87830
+
+        Reviewed by James Robinson.
+
+        * public/platform/WebKitPlatformSupport.h: pulled getProcessMemorySize up
+        to the Source/Platform/chromium/public/Platform.h
+        * src/PlatformSupport.cpp:
+
 2012-05-31  Kent Tamura  <[email protected]>
 
         Unreviewed, rolling out r119062 and r119064.

Modified: trunk/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h (119067 => 119068)


--- trunk/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h	2012-05-31 07:22:58 UTC (rev 119067)
+++ trunk/Source/WebKit/chromium/public/platform/WebKitPlatformSupport.h	2012-05-31 07:33:16 UTC (rev 119068)
@@ -115,11 +115,6 @@
 
     virtual WebSharedWorkerRepository* sharedWorkerRepository() { return 0; }
 
-    // Returns private and shared usage, in bytes. Private bytes is the amount of
-    // memory currently allocated to this process that cannot be shared. Returns
-    // false on platform specific error conditions.
-    virtual bool getProcessMemorySize(size_t* privateBytes, size_t* sharedBytes) { return false; }
-
 protected:
     ~WebKitPlatformSupport() { }
 };

Modified: trunk/Source/WebKit/chromium/src/PlatformSupport.cpp (119067 => 119068)


--- trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-05-31 07:22:58 UTC (rev 119067)
+++ trunk/Source/WebKit/chromium/src/PlatformSupport.cpp	2012-05-31 07:33:16 UTC (rev 119068)
@@ -750,11 +750,6 @@
     webFrame->client()->didExhaustMemoryAvailableForScript(webFrame);
 }
 
-bool PlatformSupport::getProcessMemorySize(size_t* privateBytes, size_t* sharedBytes)
-{
-    return webKitPlatformSupport()->getProcessMemorySize(privateBytes, sharedBytes);
-}
-
 int PlatformSupport::screenHorizontalDPI(Widget* widget)
 {
     WebWidgetClient* client = toWebWidgetClient(widget);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to