Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (140950 => 140951)
--- trunk/Source/WebKit/chromium/ChangeLog 2013-01-28 08:24:36 UTC (rev 140950)
+++ trunk/Source/WebKit/chromium/ChangeLog 2013-01-28 08:53:48 UTC (rev 140951)
@@ -1,3 +1,25 @@
+2013-01-28 Marja Hölttä <[email protected]>
+
+ Add an API for retrieving native memory information without going through the remote inspecting protocol
+ https://bugs.webkit.org/show_bug.cgi?id=107651
+
+ Reviewed by Adam Barth.
+
+ * WebKit.gyp:
+ * public/WebDevToolsAgent.h:
+ (WebKit):
+ (WebDevToolsAgent):
+ * public/WebMemoryUsageInfo.h: Added.
+ (WebKit):
+ (WebKit::WebMemoryUsageInfo::WebMemoryUsageInfo):
+ (WebMemoryUsageInfo):
+ * src/WebDevToolsAgentImpl.cpp:
+ (WebKit::WebDevToolsAgentImpl::processMemoryDistribution):
+ (WebKit):
+ * src/WebDevToolsAgentImpl.h:
+ (WebKit):
+ (WebDevToolsAgentImpl):
+
2013-01-27 Sheriff Bot <[email protected]>
Unreviewed, rolling out r140602.
Modified: trunk/Source/WebKit/chromium/WebKit.gyp (140950 => 140951)
--- trunk/Source/WebKit/chromium/WebKit.gyp 2013-01-28 08:24:36 UTC (rev 140950)
+++ trunk/Source/WebKit/chromium/WebKit.gyp 2013-01-28 08:53:48 UTC (rev 140951)
@@ -204,6 +204,7 @@
'public/WebMediaPlayerAction.h',
'public/WebMediaPlayerClient.h',
'public/WebMediaStreamRegistry.h',
+ 'public/WebMemoryUsageInfo.h',
'public/WebMenuItemInfo.h',
'public/WebNavigationType.h',
'public/WebNetworkStateNotifier.h',
Modified: trunk/Source/WebKit/chromium/public/WebDevToolsAgent.h (140950 => 140951)
--- trunk/Source/WebKit/chromium/public/WebDevToolsAgent.h 2013-01-28 08:24:36 UTC (rev 140950)
+++ trunk/Source/WebKit/chromium/public/WebDevToolsAgent.h 2013-01-28 08:53:48 UTC (rev 140951)
@@ -32,6 +32,7 @@
#define WebDevToolsAgent_h
#include "../../../Platform/chromium/public/WebCommon.h"
+#include "../../../Platform/chromium/public/WebVector.h"
namespace WebKit {
class WebDevToolsAgentClient;
@@ -43,6 +44,7 @@
class WebView;
struct WebDevToolsMessageData;
struct WebPoint;
+struct WebMemoryUsageInfo;
struct WebURLError;
class WebDevToolsAgent {
@@ -75,6 +77,8 @@
// Exposed for TestRunner.
virtual void evaluateInWebInspector(long callId, const WebString& script) = 0;
+ virtual WebVector<WebMemoryUsageInfo> processMemoryDistribution() const = 0;
+
class MessageDescriptor {
public:
virtual ~MessageDescriptor() { }
Added: trunk/Source/WebKit/chromium/public/WebMemoryUsageInfo.h (0 => 140951)
--- trunk/Source/WebKit/chromium/public/WebMemoryUsageInfo.h (rev 0)
+++ trunk/Source/WebKit/chromium/public/WebMemoryUsageInfo.h 2013-01-28 08:53:48 UTC (rev 140951)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebMemoryUsageInfo_h
+#define WebMemoryUsageInfo_h
+
+#include "../../../Platform/chromium/public/WebString.h"
+
+namespace WebKit {
+
+struct WebMemoryUsageInfo {
+ WebMemoryUsageInfo(const WebString& allocator, size_t allocated)
+ : allocatorName(allocator)
+ , allocatedBytes(allocated)
+ {
+ }
+
+ WebMemoryUsageInfo()
+ : allocatedBytes(0)
+ {
+ }
+
+ WebString allocatorName;
+ size_t allocatedBytes;
+};
+
+} // namespace WebKit
+
+#endif // WebMemoryUsageInfo_h
Modified: trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp (140950 => 140951)
--- trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp 2013-01-28 08:24:36 UTC (rev 140950)
+++ trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.cpp 2013-01-28 08:53:48 UTC (rev 140951)
@@ -55,6 +55,7 @@
#include "WebDataSource.h"
#include "WebDevToolsAgentClient.h"
#include "WebFrameImpl.h"
+#include "WebMemoryUsageInfo.h"
#include "WebViewClient.h"
#include "WebViewImpl.h"
#include <public/Platform.h>
@@ -635,6 +636,16 @@
}
}
+WebVector<WebMemoryUsageInfo> WebDevToolsAgentImpl::processMemoryDistribution() const
+{
+ HashMap<String, size_t> memoryInfo = m_webViewImpl->page()->inspectorController()->processMemoryDistribution();
+ WebVector<WebMemoryUsageInfo> memoryInfoVector((size_t)memoryInfo.size());
+ size_t i = 0;
+ for (HashMap<String, size_t>::const_iterator it = memoryInfo.begin(); it != memoryInfo.end(); ++it)
+ memoryInfoVector[i++] = WebMemoryUsageInfo(it->key, it->value);
+ return memoryInfoVector;
+}
+
void WebDevToolsAgentImpl::highlight()
{
m_webViewImpl->addPageOverlay(this, OverlayZOrders::highlight);
Modified: trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h (140950 => 140951)
--- trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h 2013-01-28 08:24:36 UTC (rev 140950)
+++ trunk/Source/WebKit/chromium/src/WebDevToolsAgentImpl.h 2013-01-28 08:53:48 UTC (rev 140951)
@@ -61,6 +61,7 @@
class WebURLRequest;
class WebURLResponse;
class WebViewImpl;
+struct WebMemoryUsageInfo;
struct WebURLError;
struct WebDevToolsMessageData;
@@ -117,6 +118,8 @@
// WebPageOverlay
virtual void paintPageOverlay(WebCanvas*);
+ virtual WebVector<WebMemoryUsageInfo> processMemoryDistribution() const;
+
private:
// WebThread::TaskObserver
virtual void willProcessTask();