Diff
Modified: trunk/Source/WebCore/CMakeLists.txt (125264 => 125265)
--- trunk/Source/WebCore/CMakeLists.txt 2012-08-10 09:30:24 UTC (rev 125264)
+++ trunk/Source/WebCore/CMakeLists.txt 2012-08-10 09:43:07 UTC (rev 125265)
@@ -1605,6 +1605,7 @@
loader/SinkDocument.cpp
loader/SubframeLoader.cpp
loader/SubresourceLoader.cpp
+ loader/SubstituteData.cpp
loader/TextResourceDecoder.cpp
loader/TextTrackLoader.cpp
loader/ThreadableLoader.cpp
Modified: trunk/Source/WebCore/ChangeLog (125264 => 125265)
--- trunk/Source/WebCore/ChangeLog 2012-08-10 09:30:24 UTC (rev 125264)
+++ trunk/Source/WebCore/ChangeLog 2012-08-10 09:43:07 UTC (rev 125265)
@@ -1,3 +1,47 @@
+2012-08-10 Yury Semikhatsky <[email protected]>
+
+ Web Inspector: further ResourceLoader memory instrumentation
+ https://bugs.webkit.org/show_bug.cgi?id=93692
+
+ Reviewed by Vsevolod Vlasov.
+
+ Added missing parts to ResourceLoader and its descendants memory instrumentation.
+ Added special logic for KURL and report the urls where we have them in instrumented classes.
+
+ * CMakeLists.txt:
+ * GNUmakefile.list.am:
+ * Target.pri:
+ * WebCore.gypi:
+ * WebCore.vcproj/WebCore.vcproj:
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/StyleSheetContents.cpp:
+ (WebCore::StyleSheetContents::reportMemoryUsage):
+ * dom/Document.cpp:
+ (WebCore::Document::reportMemoryUsage):
+ * dom/MemoryInstrumentation.cpp:
+ (WebCore::MemoryInstrumentation::addObject):
+ (WebCore):
+ * dom/MemoryInstrumentation.h:
+ (WebCore):
+ (MemoryInstrumentation):
+ (WebCore::MemoryClassInfo::addMember):
+ * loader/MainResourceLoader.cpp:
+ (WebCore::MainResourceLoader::reportMemoryUsage):
+ (WebCore):
+ * loader/MainResourceLoader.h:
+ (MainResourceLoader):
+ * loader/SubresourceLoader.cpp:
+ (WebCore::SubresourceLoader::reportMemoryUsage):
+ (WebCore):
+ * loader/SubresourceLoader.h:
+ (SubresourceLoader):
+ * loader/SubstituteData.cpp: Copied from Source/WebCore/dom/MemoryInstrumentation.cpp.
+ (WebCore):
+ (WebCore::SubstituteData::reportMemoryUsage):
+ * loader/SubstituteData.h:
+ (WebCore):
+ (SubstituteData):
+
2012-08-10 Yoshifumi Inoue <[email protected]>
[Forms] Introduce shadow elements for multiple fields time input UI
Modified: trunk/Source/WebCore/GNUmakefile.list.am (125264 => 125265)
--- trunk/Source/WebCore/GNUmakefile.list.am 2012-08-10 09:30:24 UTC (rev 125264)
+++ trunk/Source/WebCore/GNUmakefile.list.am 2012-08-10 09:43:07 UTC (rev 125265)
@@ -2987,6 +2987,7 @@
Source/WebCore/loader/SubframeLoader.h \
Source/WebCore/loader/SubresourceLoader.cpp \
Source/WebCore/loader/SubresourceLoader.h \
+ Source/WebCore/loader/SubstituteData.cpp \
Source/WebCore/loader/SubstituteData.h \
Source/WebCore/loader/SubstituteResource.h \
Source/WebCore/loader/TextResourceDecoder.cpp \
Modified: trunk/Source/WebCore/Target.pri (125264 => 125265)
--- trunk/Source/WebCore/Target.pri 2012-08-10 09:30:24 UTC (rev 125264)
+++ trunk/Source/WebCore/Target.pri 2012-08-10 09:43:07 UTC (rev 125265)
@@ -835,6 +835,7 @@
loader/SinkDocument.cpp \
loader/SubframeLoader.cpp \
loader/SubresourceLoader.cpp \
+ loader/SubstituteData.cpp \
loader/TextResourceDecoder.cpp \
loader/ThreadableLoader.cpp \
page/animation/AnimationBase.cpp \
@@ -1930,6 +1931,7 @@
loader/ProgressTracker.h \
loader/ResourceLoader.h \
loader/SubresourceLoader.h \
+ loader/SubstituteData.h \
loader/TextResourceDecoder.h \
loader/TextTrackLoader.h \
loader/ThreadableLoader.h \
Modified: trunk/Source/WebCore/WebCore.gypi (125264 => 125265)
--- trunk/Source/WebCore/WebCore.gypi 2012-08-10 09:30:24 UTC (rev 125264)
+++ trunk/Source/WebCore/WebCore.gypi 2012-08-10 09:43:07 UTC (rev 125265)
@@ -188,6 +188,7 @@
'loader/ResourceLoaderOptions.h',
'loader/SubframeLoader.h',
'loader/SubresourceLoader.h',
+ 'loader/SubstituteData.cpp',
'loader/SubstituteData.h',
'loader/SubstituteResource.h',
'loader/TextResourceDecoder.h',
Modified: trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj (125264 => 125265)
--- trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2012-08-10 09:30:24 UTC (rev 125264)
+++ trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj 2012-08-10 09:43:07 UTC (rev 125265)
@@ -27631,6 +27631,10 @@
>
</File>
<File
+ RelativePath="..\loader\SubstituteData.cpp"
+ >
+ </File>
+ <File
RelativePath="..\loader\SubstituteData.h"
>
</File>
Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (125264 => 125265)
--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-08-10 09:30:24 UTC (rev 125264)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2012-08-10 09:43:07 UTC (rev 125265)
@@ -6144,6 +6144,7 @@
F33F0282120947F200E5743A /* ScriptProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F33F0281120947F200E5743A /* ScriptProfile.cpp */; };
F33F053D120B0DA500E5743A /* InspectorDebuggerAgent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F33F053B120B0DA500E5743A /* InspectorDebuggerAgent.cpp */; };
F33F053E120B0DA500E5743A /* InspectorDebuggerAgent.h in Headers */ = {isa = PBXBuildFile; fileRef = F33F053C120B0DA500E5743A /* InspectorDebuggerAgent.h */; };
+ F343A70A15D3F56E0032D016 /* SubstituteData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F343A70915D3F56E0032D016 /* SubstituteData.cpp */; };
F344C7141125B82C00F26EEE /* InspectorFrontendClient.h in Headers */ = {isa = PBXBuildFile; fileRef = F344C7121125B82C00F26EEE /* InspectorFrontendClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
F344C75311294D9D00F26EEE /* InspectorFrontendClientLocal.h in Headers */ = {isa = PBXBuildFile; fileRef = F344C75211294D9D00F26EEE /* InspectorFrontendClientLocal.h */; settings = {ATTRIBUTES = (Private, ); }; };
F344C75811294FF600F26EEE /* InspectorFrontendClientLocal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F344C75711294FF600F26EEE /* InspectorFrontendClientLocal.cpp */; };
@@ -13487,6 +13488,7 @@
F33F0281120947F200E5743A /* ScriptProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptProfile.cpp; sourceTree = "<group>"; };
F33F053B120B0DA500E5743A /* InspectorDebuggerAgent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorDebuggerAgent.cpp; sourceTree = "<group>"; };
F33F053C120B0DA500E5743A /* InspectorDebuggerAgent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorDebuggerAgent.h; sourceTree = "<group>"; };
+ F343A70915D3F56E0032D016 /* SubstituteData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SubstituteData.cpp; sourceTree = "<group>"; };
F344C7121125B82C00F26EEE /* InspectorFrontendClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFrontendClient.h; sourceTree = "<group>"; };
F344C75211294D9D00F26EEE /* InspectorFrontendClientLocal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorFrontendClientLocal.h; sourceTree = "<group>"; };
F344C75711294FF600F26EEE /* InspectorFrontendClientLocal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorFrontendClientLocal.cpp; sourceTree = "<group>"; };
@@ -20563,6 +20565,7 @@
D000ED2611C1B9CD00C47726 /* SubframeLoader.h */,
93E227DF0AF589AD00D48324 /* SubresourceLoader.cpp */,
656D37300ADBA5DE00A4554D /* SubresourceLoader.h */,
+ F343A70915D3F56E0032D016 /* SubstituteData.cpp */,
659A7D120B6DB4D9001155B3 /* SubstituteData.h */,
1A8F6B010DB53006001DB794 /* SubstituteResource.h */,
F523D27802DE43D7018635CA /* TextResourceDecoder.cpp */,
@@ -28062,6 +28065,7 @@
F55B3DD31251F12D003EF269 /* SubmitInputType.cpp in Sources */,
93E227E40AF589AD00D48324 /* SubresourceLoader.cpp in Sources */,
7E37EF2E1339208800B29250 /* SubresourceLoaderCF.cpp in Sources */,
+ F343A70A15D3F56E0032D016 /* SubstituteData.cpp in Sources */,
93B2D8180F9920EE006AE6B2 /* SuddenTermination.mm in Sources */,
087558C513B4A57D00F49307 /* SurrogatePairAwareTextIterator.cpp in Sources */,
62C1217C11AB9E77003C462C /* SuspendableTimer.cpp in Sources */,
Modified: trunk/Source/WebCore/css/StyleSheetContents.cpp (125264 => 125265)
--- trunk/Source/WebCore/css/StyleSheetContents.cpp 2012-08-10 09:30:24 UTC (rev 125264)
+++ trunk/Source/WebCore/css/StyleSheetContents.cpp 2012-08-10 09:43:07 UTC (rev 125265)
@@ -486,6 +486,7 @@
{
MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
info.addMember(m_originalURL);
+ info.addMember(m_finalURL);
info.addMember(m_encodingFromCharsetRule);
info.addVector(m_importRules);
info.addInstrumentedVector(m_childRules);
Modified: trunk/Source/WebCore/dom/Document.cpp (125264 => 125265)
--- trunk/Source/WebCore/dom/Document.cpp 2012-08-10 09:30:24 UTC (rev 125264)
+++ trunk/Source/WebCore/dom/Document.cpp 2012-08-10 09:43:07 UTC (rev 125265)
@@ -6094,6 +6094,12 @@
info.addInstrumentedMember(m_styleResolver);
ContainerNode::reportMemoryUsage(memoryObjectInfo);
info.addVector(m_customFonts);
+ info.addMember(m_url);
+ info.addMember(m_baseURL);
+ info.addMember(m_baseURLOverride);
+ info.addMember(m_baseElementURL);
+ info.addMember(m_cookieURL);
+ info.addMember(m_firstPartyForCookies);
info.addMember(m_documentURI);
info.addMember(m_baseTarget);
info.addInstrumentedMember(m_frame);
Modified: trunk/Source/WebCore/dom/MemoryInstrumentation.cpp (125264 => 125265)
--- trunk/Source/WebCore/dom/MemoryInstrumentation.cpp 2012-08-10 09:30:24 UTC (rev 125264)
+++ trunk/Source/WebCore/dom/MemoryInstrumentation.cpp 2012-08-10 09:43:07 UTC (rev 125265)
@@ -31,6 +31,7 @@
#include "config.h"
#include "MemoryInstrumentation.h"
+#include "KURL.h"
#include <wtf/text/StringImpl.h>
#include <wtf/text/WTFString.h>
@@ -48,4 +49,13 @@
countObjectSize(objectType, stringImpl->sizeInBytes());
}
+void MemoryInstrumentation::addObject(const KURL& url, ObjectType objectType)
+{
+ if (visited(&url))
+ return;
+ addObject(url.string(), objectType);
+ if (url.innerURL())
+ addObject(url.innerURL(), objectType);
+}
+
} // namespace WebCore
Modified: trunk/Source/WebCore/dom/MemoryInstrumentation.h (125264 => 125265)
--- trunk/Source/WebCore/dom/MemoryInstrumentation.h 2012-08-10 09:30:24 UTC (rev 125264)
+++ trunk/Source/WebCore/dom/MemoryInstrumentation.h 2012-08-10 09:43:07 UTC (rev 125265)
@@ -41,6 +41,7 @@
namespace WebCore {
template <typename T> class DataRef;
+class KURL;
class MemoryObjectInfo;
class MemoryInstrumentation {
@@ -103,6 +104,7 @@
}
void addObject(const String&, ObjectType);
void addObject(const StringImpl*, ObjectType);
+ void addObject(const KURL&, ObjectType);
template <typename T> void addInstrumentedObject(const T& t, ObjectType ownerObjectType) { OwningTraits<T>::addInstrumentedObject(this, t, ownerObjectType); }
template <typename HashMapType> void addHashMap(const HashMapType&, ObjectType, bool contentOnly = false);
template <typename HashSetType> void addHashSet(const HashSetType&, ObjectType, bool contentOnly = false);
@@ -207,6 +209,7 @@
void addMember(const String& string) { m_memoryInstrumentation->addObject(string, m_objectType); }
void addMember(const AtomicString& string) { m_memoryInstrumentation->addObject((const String&)string, m_objectType); }
void addMember(const StringImpl* string) { m_memoryInstrumentation->addObject(string, m_objectType); }
+ void addMember(const KURL& url) { m_memoryInstrumentation->addObject(url, m_objectType); }
private:
MemoryObjectInfo* m_memoryObjectInfo;
Modified: trunk/Source/WebCore/loader/MainResourceLoader.cpp (125264 => 125265)
--- trunk/Source/WebCore/loader/MainResourceLoader.cpp 2012-08-10 09:30:24 UTC (rev 125264)
+++ trunk/Source/WebCore/loader/MainResourceLoader.cpp 2012-08-10 09:43:07 UTC (rev 125265)
@@ -544,6 +544,15 @@
receivedError(error);
}
+void MainResourceLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+ MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::Loader);
+ ResourceLoader::reportMemoryUsage(memoryObjectInfo);
+ info.addMember(m_initialRequest);
+ info.addInstrumentedMember(m_substituteData);
+ info.addMember(m_dataLoadTimer);
+}
+
void MainResourceLoader::handleEmptyLoad(const KURL& url, bool forURLScheme)
{
String mimeType;
Modified: trunk/Source/WebCore/loader/MainResourceLoader.h (125264 => 125265)
--- trunk/Source/WebCore/loader/MainResourceLoader.h 2012-08-10 09:30:24 UTC (rev 125264)
+++ trunk/Source/WebCore/loader/MainResourceLoader.h 2012-08-10 09:43:07 UTC (rev 125265)
@@ -73,6 +73,8 @@
bool isLoadingMultipartContent() const { return m_loadingMultipartContent; }
+ virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
+
private:
explicit MainResourceLoader(Frame*);
Modified: trunk/Source/WebCore/loader/SubresourceLoader.cpp (125264 => 125265)
--- trunk/Source/WebCore/loader/SubresourceLoader.cpp 2012-08-10 09:30:24 UTC (rev 125264)
+++ trunk/Source/WebCore/loader/SubresourceLoader.cpp 2012-08-10 09:43:07 UTC (rev 125265)
@@ -36,6 +36,7 @@
#include "FrameLoader.h"
#include "Logging.h"
#include "MemoryCache.h"
+#include "MemoryInstrumentation.h"
#include "SecurityOrigin.h"
#include "SecurityPolicy.h"
#include <wtf/RefCountedLeakCounter.h>
@@ -129,6 +130,15 @@
ResourceLoader::cancel();
}
+void SubresourceLoader::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+ MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::Loader);
+ ResourceLoader::reportMemoryUsage(memoryObjectInfo);
+ info.addInstrumentedMember(m_resource);
+ info.addInstrumentedMember(m_document);
+ info.addMember(m_requestCountTracker);
+}
+
bool SubresourceLoader::init(const ResourceRequest& request)
{
if (!ResourceLoader::init(request))
Modified: trunk/Source/WebCore/loader/SubresourceLoader.h (125264 => 125265)
--- trunk/Source/WebCore/loader/SubresourceLoader.h 2012-08-10 09:30:24 UTC (rev 125264)
+++ trunk/Source/WebCore/loader/SubresourceLoader.h 2012-08-10 09:43:07 UTC (rev 125265)
@@ -47,6 +47,8 @@
void cancelIfNotFinishing();
+ virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
+
private:
SubresourceLoader(Frame*, CachedResource*, const ResourceLoaderOptions&);
virtual ~SubresourceLoader();
Copied: trunk/Source/WebCore/loader/SubstituteData.cpp (from rev 125264, trunk/Source/WebCore/dom/MemoryInstrumentation.cpp) (0 => 125265)
--- trunk/Source/WebCore/loader/SubstituteData.cpp (rev 0)
+++ trunk/Source/WebCore/loader/SubstituteData.cpp 2012-08-10 09:43:07 UTC (rev 125265)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2012 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.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "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.
+ */
+
+#include "config.h"
+#include "SubstituteData.h"
+
+#include "MemoryInstrumentation.h"
+
+namespace WebCore {
+
+void SubstituteData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+ MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::Loader);
+ info.addInstrumentedMember(m_content);
+ info.addMember(m_mimeType);
+ info.addMember(m_textEncoding);
+ info.addMember(m_failingURL);
+ info.addMember(m_responseURL);
+}
+
+}
Modified: trunk/Source/WebCore/loader/SubstituteData.h (125264 => 125265)
--- trunk/Source/WebCore/loader/SubstituteData.h 2012-08-10 09:30:24 UTC (rev 125264)
+++ trunk/Source/WebCore/loader/SubstituteData.h 2012-08-10 09:43:07 UTC (rev 125265)
@@ -34,6 +34,8 @@
namespace WebCore {
+ class MemoryObjectInfo;
+
class SubstituteData {
public:
SubstituteData() { }
@@ -54,6 +56,8 @@
const String& textEncoding() const { return m_textEncoding; }
const KURL& failingURL() const { return m_failingURL; }
const KURL& responseURL() const { return m_responseURL; }
+
+ void reportMemoryUsage(MemoryObjectInfo*) const;
private:
RefPtr<SharedBuffer> m_content;