Diff
Modified: trunk/Source/Platform/ChangeLog (124331 => 124332)
--- trunk/Source/Platform/ChangeLog 2012-08-01 13:39:45 UTC (rev 124331)
+++ trunk/Source/Platform/ChangeLog 2012-08-01 13:55:07 UTC (rev 124332)
@@ -1,3 +1,16 @@
+2012-08-01 Alexei Filippov <[email protected]>
+
+ Web Inspector: count DOM storage cache memory for native snapshot
+ https://bugs.webkit.org/show_bug.cgi?id=91617
+
+ Reviewed by Yury Semikhatsky.
+
+ Add memory size used for DOM storage cache reporting interface.
+
+ * chromium/public/WebStorageArea.h:
+ (WebStorageArea):
+ (WebKit::WebStorageArea::memoryBytesUsedByCache):
+
2012-07-31 Chris Rogers <[email protected]>
Allow AudioDestination to support local/live audio input
Modified: trunk/Source/Platform/chromium/public/WebStorageArea.h (124331 => 124332)
--- trunk/Source/Platform/chromium/public/WebStorageArea.h 2012-08-01 13:39:45 UTC (rev 124331)
+++ trunk/Source/Platform/chromium/public/WebStorageArea.h 2012-08-01 13:55:07 UTC (rev 124332)
@@ -84,6 +84,9 @@
clear(pageUrl, unused);
}
+ // Returns amount of bytes occupied by the storage cache in physical memory.
+ virtual size_t memoryBytesUsedByCache() const { return 0; }
+
// DEPRECATED - being replaced by the async variants above which do not return oldValues or block until completion.
virtual void setItem(const WebString& key, const WebString& newValue, const WebURL&, Result&, WebString& oldValue) { }
virtual void removeItem(const WebString& key, const WebURL& pageUrl, WebString& oldValue) { }
Modified: trunk/Source/WebCore/ChangeLog (124331 => 124332)
--- trunk/Source/WebCore/ChangeLog 2012-08-01 13:39:45 UTC (rev 124331)
+++ trunk/Source/WebCore/ChangeLog 2012-08-01 13:55:07 UTC (rev 124332)
@@ -1,3 +1,40 @@
+2012-08-01 Alexei Filippov <[email protected]>
+
+ Web Inspector: count DOM storage cache memory for native snapshot
+ https://bugs.webkit.org/show_bug.cgi?id=91617
+
+ Reviewed by Yury Semikhatsky.
+
+ Add memory size used for DOM storage cache reporting interface.
+ Report it to the native memory snapshot instrumentation framework.
+
+ * inspector/InspectorController.cpp:
+ (WebCore::InspectorController::InspectorController):
+ * inspector/InspectorDOMStorageAgent.cpp:
+ (WebCore::InspectorDOMStorageAgent::memoryBytesUsedByStorageCache):
+ (WebCore):
+ * inspector/InspectorDOMStorageAgent.h:
+ (InspectorDOMStorageAgent):
+ * inspector/InspectorMemoryAgent.cpp:
+ (MemoryBlockName):
+ (WebCore):
+ (WebCore::dumpDOMStorageCache):
+ (WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):
+ (WebCore::InspectorMemoryAgent::InspectorMemoryAgent):
+ * inspector/InspectorMemoryAgent.h:
+ (WebCore):
+ (WebCore::InspectorMemoryAgent::create):
+ (InspectorMemoryAgent):
+ * inspector/front-end/NativeMemorySnapshotView.js:
+ (WebInspector.MemoryBlockViewProperties._initialize):
+ * storage/StorageArea.h:
+ (StorageArea):
+ * storage/StorageAreaImpl.cpp:
+ (WebCore::StorageAreaImpl::memoryBytesUsedByCache):
+ (WebCore):
+ * storage/StorageAreaImpl.h:
+ (StorageAreaImpl):
+
2012-07-31 Yury Semikhatsky <[email protected]>
Web Inspector: add CSSStyleSheet memory instrumentation
Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (124331 => 124332)
--- trunk/Source/WebCore/inspector/InspectorController.cpp 2012-08-01 13:39:45 UTC (rev 124331)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp 2012-08-01 13:55:07 UTC (rev 124332)
@@ -114,7 +114,7 @@
OwnPtr<InspectorDOMStorageAgent> domStorageAgentPtr(InspectorDOMStorageAgent::create(m_instrumentingAgents.get(), m_state.get()));
InspectorDOMStorageAgent* domStorageAgent = domStorageAgentPtr.get();
m_agents.append(domStorageAgentPtr.release());
- m_agents.append(InspectorMemoryAgent::create(m_instrumentingAgents.get(), m_state.get(), m_page, m_domAgent));
+ m_agents.append(InspectorMemoryAgent::create(m_instrumentingAgents.get(), m_state.get(), m_page, domStorageAgent));
m_agents.append(InspectorTimelineAgent::create(m_instrumentingAgents.get(), pageAgent, m_state.get(), InspectorTimelineAgent::PageInspector,
inspectorClient));
m_agents.append(InspectorApplicationCacheAgent::create(m_instrumentingAgents.get(), m_state.get(), pageAgent));
Modified: trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp (124331 => 124332)
--- trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp 2012-08-01 13:39:45 UTC (rev 124331)
+++ trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.cpp 2012-08-01 13:55:07 UTC (rev 124332)
@@ -214,7 +214,15 @@
m_resources.clear();
}
+size_t InspectorDOMStorageAgent::memoryBytesUsedByStorageCache() const
+{
+ size_t size = 0;
+ for (DOMStorageResourcesMap::const_iterator it = m_resources.begin(); it != m_resources.end(); ++it)
+ size += it->second->storageArea()->memoryBytesUsedByCache();
+ return size;
+}
+
} // namespace WebCore
#endif // ENABLE(INSPECTOR)
Modified: trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.h (124331 => 124332)
--- trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.h 2012-08-01 13:39:45 UTC (rev 124331)
+++ trunk/Source/WebCore/inspector/InspectorDOMStorageAgent.h 2012-08-01 13:55:07 UTC (rev 124332)
@@ -78,6 +78,9 @@
void didUseDOMStorage(StorageArea*, bool isLocalStorage, Frame*);
void didDispatchDOMStorageEvent(const String& key, const String& oldValue, const String& newValue, StorageType, SecurityOrigin*, Page*);
+ // Called from InspectorMemoryAgent
+ size_t memoryBytesUsedByStorageCache() const;
+
private:
InspectorDOMStorageAgent(InstrumentingAgents*, InspectorState*);
Modified: trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp (124331 => 124332)
--- trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp 2012-08-01 13:39:45 UTC (rev 124331)
+++ trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp 2012-08-01 13:55:07 UTC (rev 124332)
@@ -39,6 +39,7 @@
#include "Document.h"
#include "EventListenerMap.h"
#include "Frame.h"
+#include "InspectorDOMStorageAgent.h"
#include "InspectorFrontend.h"
#include "InspectorState.h"
#include "InspectorValues.h"
@@ -97,6 +98,8 @@
static const char domTreeCSS[] = "DOMTreeCSS";
static const char domTreeBinding[] = "DOMTreeBinding";
static const char domTreeLoader[] = "DOMTreeLoader";
+
+static const char domStorageCache[] = "DOMStorageCache";
}
namespace {
@@ -569,6 +572,13 @@
return externalResourcesStats.release();
}
+static PassRefPtr<InspectorMemoryBlock> dumpDOMStorageCache(size_t cacheSize)
+{
+ RefPtr<InspectorMemoryBlock> domStorageCache = InspectorMemoryBlock::create().setName(MemoryBlockName::domStorageCache);
+ domStorageCache->setSize(cacheSize);
+ return domStorageCache;
+}
+
void InspectorMemoryAgent::getProcessMemoryDistribution(ErrorString*, RefPtr<InspectorMemoryBlock>& processMemory)
{
processMemory = InspectorMemoryBlock::create().setName(MemoryBlockName::processPrivateMemory);
@@ -584,6 +594,7 @@
children->addItem(domTreeInfo(m_page, visitedObjects, &inspectorData)); // FIXME: collect for all pages?
children->addItem(jsExternalResourcesInfo(visitedObjects));
children->addItem(inspectorData.dumpStatistics());
+ children->addItem(dumpDOMStorageCache(m_domStorageAgent->memoryBytesUsedByStorageCache()));
addPlatformComponentsInfo(children);
processMemory->setChildren(children);
@@ -593,9 +604,10 @@
processMemory->setSize(privateBytes);
}
-InspectorMemoryAgent::InspectorMemoryAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page, InspectorDOMAgent*)
+InspectorMemoryAgent::InspectorMemoryAgent(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page, InspectorDOMStorageAgent* domStorageAgent)
: InspectorBaseAgent<InspectorMemoryAgent>("Memory", instrumentingAgents, state)
, m_page(page)
+ , m_domStorageAgent(domStorageAgent)
{
}
Modified: trunk/Source/WebCore/inspector/InspectorMemoryAgent.h (124331 => 124332)
--- trunk/Source/WebCore/inspector/InspectorMemoryAgent.h 2012-08-01 13:39:45 UTC (rev 124331)
+++ trunk/Source/WebCore/inspector/InspectorMemoryAgent.h 2012-08-01 13:55:07 UTC (rev 124332)
@@ -38,10 +38,9 @@
#include <wtf/RefPtr.h>
namespace WebCore {
-class InspectorDOMAgent;
-class InspectorFrontend;
+
+class InspectorDOMStorageAgent;
class InspectorState;
-class InspectorArray;
class InstrumentingAgents;
class Page;
@@ -52,19 +51,19 @@
public:
typedef Vector<OwnPtr<InspectorBaseAgentInterface> > InspectorAgents;
- static PassOwnPtr<InspectorMemoryAgent> create(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page, InspectorDOMAgent* domAgent)
+ static PassOwnPtr<InspectorMemoryAgent> create(InstrumentingAgents* instrumentingAgents, InspectorState* state, Page* page, InspectorDOMStorageAgent* domStorageAgent)
{
- return adoptPtr(new InspectorMemoryAgent(instrumentingAgents, state, page, domAgent));
+ return adoptPtr(new InspectorMemoryAgent(instrumentingAgents, state, page, domStorageAgent));
}
virtual ~InspectorMemoryAgent();
virtual void getDOMNodeCount(ErrorString*, RefPtr<TypeBuilder::Array<TypeBuilder::Memory::DOMGroup> >& domGroups, RefPtr<TypeBuilder::Memory::StringStatistics>& strings);
virtual void getProcessMemoryDistribution(ErrorString*, RefPtr<TypeBuilder::Memory::MemoryBlock>& processMemory);
-
private:
- InspectorMemoryAgent(InstrumentingAgents*, InspectorState*, Page*, InspectorDOMAgent* domAgent);
+ InspectorMemoryAgent(InstrumentingAgents*, InspectorState*, Page*, InspectorDOMStorageAgent*);
Page* m_page;
+ InspectorDOMStorageAgent* m_domStorageAgent;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js (124331 => 124332)
--- trunk/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js 2012-08-01 13:39:45 UTC (rev 124331)
+++ trunk/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js 2012-08-01 13:55:07 UTC (rev 124332)
@@ -225,6 +225,7 @@
addBlock("hsl(210, 60%, 80%)", "InspectorData", "Inspector data");
addBlock("hsl( 30, 60%, 80%)", "MemoryCache", "Memory cache resources");
addBlock("hsl( 40, 60%, 80%)", "GlyphCache", "Glyph cache resources");
+ addBlock("hsl( 35, 60%, 80%)", "DOMStorageCache", "DOM storage cache");
addBlock("hsl( 60, 60%, 80%)", "RenderTreeAllocated", "Render tree");
addBlock("hsl( 60, 60%, 80%)", "RenderTreeUsed", "Render tree used");
}
Modified: trunk/Source/WebCore/storage/StorageArea.h (124331 => 124332)
--- trunk/Source/WebCore/storage/StorageArea.h 2012-08-01 13:39:45 UTC (rev 124331)
+++ trunk/Source/WebCore/storage/StorageArea.h 2012-08-01 13:55:07 UTC (rev 124332)
@@ -56,6 +56,8 @@
virtual bool disabledByPrivateBrowsingInFrame(const Frame* sourceFrame) const = 0;
+ virtual size_t memoryBytesUsedByCache() const = 0;
+
virtual void incrementAccessCount() { }
virtual void decrementAccessCount() { }
};
Modified: trunk/Source/WebCore/storage/StorageAreaImpl.cpp (124331 => 124332)
--- trunk/Source/WebCore/storage/StorageAreaImpl.cpp 2012-08-01 13:39:45 UTC (rev 124331)
+++ trunk/Source/WebCore/storage/StorageAreaImpl.cpp 2012-08-01 13:55:07 UTC (rev 124332)
@@ -264,6 +264,11 @@
m_storageAreaSync->blockUntilImportComplete();
}
+size_t StorageAreaImpl::memoryBytesUsedByCache() const
+{
+ return 0;
+}
+
void StorageAreaImpl::incrementAccessCount()
{
m_accessCount++;
Modified: trunk/Source/WebCore/storage/StorageAreaImpl.h (124331 => 124332)
--- trunk/Source/WebCore/storage/StorageAreaImpl.h 2012-08-01 13:39:45 UTC (rev 124331)
+++ trunk/Source/WebCore/storage/StorageAreaImpl.h 2012-08-01 13:55:07 UTC (rev 124332)
@@ -54,6 +54,8 @@
virtual bool disabledByPrivateBrowsingInFrame(const Frame* sourceFrame) const;
+ virtual size_t memoryBytesUsedByCache() const;
+
virtual void incrementAccessCount();
virtual void decrementAccessCount();
Modified: trunk/Source/WebKit/chromium/ChangeLog (124331 => 124332)
--- trunk/Source/WebKit/chromium/ChangeLog 2012-08-01 13:39:45 UTC (rev 124331)
+++ trunk/Source/WebKit/chromium/ChangeLog 2012-08-01 13:55:07 UTC (rev 124332)
@@ -1,3 +1,18 @@
+2012-08-01 Alexei Filippov <[email protected]>
+
+ Web Inspector: count DOM storage cache memory for native snapshot
+ https://bugs.webkit.org/show_bug.cgi?id=91617
+
+ Reviewed by Yury Semikhatsky.
+
+ Add memory size used for DOM storage cache reporting interface.
+
+ * src/StorageAreaProxy.cpp:
+ (WebCore::StorageAreaProxy::memoryBytesUsedByCache):
+ (WebCore):
+ * src/StorageAreaProxy.h:
+ (StorageAreaProxy):
+
2012-07-31 Yoshifumi Inoue <[email protected]>
[Chromium] Enable ENABLE_INPUT_TYPE_TIME_MULTIPLE_FIELDS
Modified: trunk/Source/WebKit/chromium/src/StorageAreaProxy.cpp (124331 => 124332)
--- trunk/Source/WebKit/chromium/src/StorageAreaProxy.cpp 2012-08-01 13:39:45 UTC (rev 124331)
+++ trunk/Source/WebKit/chromium/src/StorageAreaProxy.cpp 2012-08-01 13:55:07 UTC (rev 124332)
@@ -120,6 +120,11 @@
return !webView->permissionClient() || webView->permissionClient()->allowStorage(webFrame, m_storageType == LocalStorage);
}
+size_t StorageAreaProxy::memoryBytesUsedByCache() const
+{
+ return m_storageArea->memoryBytesUsedByCache();
+}
+
void StorageAreaProxy::dispatchLocalStorageEvent(PageGroup* pageGroup, const String& key, const String& oldValue, const String& newValue,
SecurityOrigin* securityOrigin, const KURL& pageURL, WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess)
{
Modified: trunk/Source/WebKit/chromium/src/StorageAreaProxy.h (124331 => 124332)
--- trunk/Source/WebKit/chromium/src/StorageAreaProxy.h 2012-08-01 13:39:45 UTC (rev 124331)
+++ trunk/Source/WebKit/chromium/src/StorageAreaProxy.h 2012-08-01 13:55:07 UTC (rev 124332)
@@ -58,6 +58,8 @@
virtual bool disabledByPrivateBrowsingInFrame(const Frame*) const { return false; }
+ virtual size_t memoryBytesUsedByCache() const;
+
static void dispatchLocalStorageEvent(
PageGroup*, const String& key, const String& oldValue, const String& newValue,
SecurityOrigin*, const KURL& pageURL, WebKit::WebStorageArea* sourceAreaInstance, bool originatedInProcess);