Title: [130187] trunk/Source
Revision
130187
Author
loi...@chromium.org
Date
2012-10-02 10:55:54 -0700 (Tue, 02 Oct 2012)

Log Message

Web Inspector: NMI: switch to non intrusive instrumentation of ParsedURL.
https://bugs.webkit.org/show_bug.cgi?id=98150

Reviewed by Yury Semikhatsky.

Source/WebCore:

Style changes.

* platform/KURLWTFURLImpl.h:
(WebCore::KURLWTFURLImpl::reportMemoryUsage):

Source/WTF:

Memory instrumentation for ParsedURL was extracted into separate header MemoryInstrumentationParsedURL.h

Drive by fix: unnecessary include was removed from String*.cpp files.

* GNUmakefile.list.am:
* WTF.gypi:
* WTF.pro:
* WTF.xcodeproj/project.pbxproj:
* wtf/MemoryInstrumentation.h:
(WTF):
* wtf/MemoryInstrumentationParsedURL.h: Added.
(WTF):
(WTF::reportMemoryUsage):
* wtf/text/AtomicString.cpp:
* wtf/text/StringImpl.cpp:
* wtf/text/WTFString.cpp:
* wtf/url/api/ParsedURL.cpp:
* wtf/url/api/ParsedURL.h:
* wtf/url/api/URLString.cpp:
* wtf/url/api/URLString.h:

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (130186 => 130187)


--- trunk/Source/WTF/ChangeLog	2012-10-02 17:53:38 UTC (rev 130186)
+++ trunk/Source/WTF/ChangeLog	2012-10-02 17:55:54 UTC (rev 130187)
@@ -1,3 +1,31 @@
+2012-10-02  Ilya Tikhonovsky  <loi...@chromium.org>
+
+        Web Inspector: NMI: switch to non intrusive instrumentation of ParsedURL.
+        https://bugs.webkit.org/show_bug.cgi?id=98150
+
+        Reviewed by Yury Semikhatsky.
+
+        Memory instrumentation for ParsedURL was extracted into separate header MemoryInstrumentationParsedURL.h
+
+        Drive by fix: unnecessary include was removed from String*.cpp files.
+
+        * GNUmakefile.list.am:
+        * WTF.gypi:
+        * WTF.pro:
+        * WTF.xcodeproj/project.pbxproj:
+        * wtf/MemoryInstrumentation.h:
+        (WTF):
+        * wtf/MemoryInstrumentationParsedURL.h: Added.
+        (WTF):
+        (WTF::reportMemoryUsage):
+        * wtf/text/AtomicString.cpp:
+        * wtf/text/StringImpl.cpp:
+        * wtf/text/WTFString.cpp:
+        * wtf/url/api/ParsedURL.cpp:
+        * wtf/url/api/ParsedURL.h:
+        * wtf/url/api/URLString.cpp:
+        * wtf/url/api/URLString.h:
+
 2012-09-29  Ilya Tikhonovsky  <loi...@chromium.org>
 
         Web Inspector: NMI make String* instrumentation non intrusive

Modified: trunk/Source/WTF/GNUmakefile.list.am (130186 => 130187)


--- trunk/Source/WTF/GNUmakefile.list.am	2012-10-02 17:53:38 UTC (rev 130186)
+++ trunk/Source/WTF/GNUmakefile.list.am	2012-10-02 17:55:54 UTC (rev 130187)
@@ -83,6 +83,7 @@
     Source/WTF/wtf/MemoryInstrumentationArrayBufferView.h \
     Source/WTF/wtf/MemoryInstrumentationHashMap.h \
     Source/WTF/wtf/MemoryInstrumentationHashSet.h \
+    Source/WTF/wtf/MemoryInstrumentationParsedURL.h \
     Source/WTF/wtf/MemoryInstrumentationString.h \
     Source/WTF/wtf/MemoryInstrumentationVector.h \
     Source/WTF/wtf/MessageQueue.h \

Modified: trunk/Source/WTF/WTF.gypi (130186 => 130187)


--- trunk/Source/WTF/WTF.gypi	2012-10-02 17:53:38 UTC (rev 130186)
+++ trunk/Source/WTF/WTF.gypi	2012-10-02 17:55:54 UTC (rev 130187)
@@ -53,6 +53,7 @@
             'wtf/MemoryInstrumentationArrayBufferView.h',
             'wtf/MemoryInstrumentationHashMap.h',
             'wtf/MemoryInstrumentationHashSet.h',
+            'wtf/MemoryInstrumentationParsedURL.h',
             'wtf/MemoryInstrumentationString.h',
             'wtf/MemoryInstrumentationVector.h',
             'wtf/MessageQueue.h',

Modified: trunk/Source/WTF/WTF.pro (130186 => 130187)


--- trunk/Source/WTF/WTF.pro	2012-10-02 17:53:38 UTC (rev 130186)
+++ trunk/Source/WTF/WTF.pro	2012-10-02 17:55:54 UTC (rev 130187)
@@ -90,6 +90,7 @@
     MemoryInstrumentationArrayBufferView.h \
     MemoryInstrumentationHashMap.h \
     MemoryInstrumentationHashSet.h \
+    MemoryInstrumentationParsedURL.h \
     MemoryInstrumentationString.h \
     MemoryInstrumentationVector.h \
     MessageQueue.h \

Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (130186 => 130187)


--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2012-10-02 17:53:38 UTC (rev 130186)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj	2012-10-02 17:55:54 UTC (rev 130187)
@@ -44,6 +44,7 @@
 		4F1D115415FF11BE0026E908 /* MemoryInstrumentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F1D115315FF11BE0026E908 /* MemoryInstrumentation.h */; };
 		4FCB710A160A1A07008425EC /* MemoryInstrumentationVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FCB7109160A1A07008425EC /* MemoryInstrumentationVector.h */; };
 		4FCF27E116172E8600CBF037 /* MemoryInstrumentationString.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FCF27E016172E8600CBF037 /* MemoryInstrumentationString.h */; };
+		4FD2A359161B0EE100EBF236 /* MemoryInstrumentationParsedURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FD2A358161B0EE100EBF236 /* MemoryInstrumentationParsedURL.h */; };
 		4FD8554716133E0E00C5B704 /* MemoryInstrumentationArrayBufferView.h in Headers */ = {isa = PBXBuildFile; fileRef = 4FD8554616133E0E00C5B704 /* MemoryInstrumentationArrayBufferView.h */; };
 		7E29C33E15FFD79B00516D61 /* ObjcRuntimeExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E29C33D15FFD79B00516D61 /* ObjcRuntimeExtras.h */; };
 		8134013815B092FD001FF0B8 /* Base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8134013615B092FD001FF0B8 /* Base64.cpp */; };
@@ -317,6 +318,7 @@
 		4F1D115315FF11BE0026E908 /* MemoryInstrumentation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryInstrumentation.h; sourceTree = "<group>"; };
 		4FCB7109160A1A07008425EC /* MemoryInstrumentationVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryInstrumentationVector.h; sourceTree = "<group>"; };
 		4FCF27E016172E8600CBF037 /* MemoryInstrumentationString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryInstrumentationString.h; sourceTree = "<group>"; };
+		4FD2A358161B0EE100EBF236 /* MemoryInstrumentationParsedURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryInstrumentationParsedURL.h; sourceTree = "<group>"; };
 		4FD8554616133E0E00C5B704 /* MemoryInstrumentationArrayBufferView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryInstrumentationArrayBufferView.h; sourceTree = "<group>"; };
 		5D247B6214689B8600E78B76 /* libWTF.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libWTF.a; sourceTree = BUILT_PRODUCTS_DIR; };
 		5D247B6E14689C4700E78B76 /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = "<group>"; };
@@ -703,6 +705,7 @@
 				4FD8554616133E0E00C5B704 /* MemoryInstrumentationArrayBufferView.h */,
 				F3525E451619A4EE00278BC1 /* MemoryInstrumentationHashMap.h */,
 				4F1B2DB5160B44AA00586559 /* MemoryInstrumentationHashSet.h */,
+				4FD2A358161B0EE100EBF236 /* MemoryInstrumentationParsedURL.h */,
 				4FCF27E016172E8600CBF037 /* MemoryInstrumentationString.h */,
 				4FCB7109160A1A07008425EC /* MemoryInstrumentationVector.h */,
 				A8A472CC151A825B004123FF /* MessageQueue.h */,
@@ -1161,6 +1164,7 @@
 				4FD8554716133E0E00C5B704 /* MemoryInstrumentationArrayBufferView.h in Headers */,
 				F3525E461619A4EE00278BC1 /* MemoryInstrumentationHashMap.h in Headers */,
 				4FCF27E116172E8600CBF037 /* MemoryInstrumentationString.h in Headers */,
+				4FD2A359161B0EE100EBF236 /* MemoryInstrumentationParsedURL.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

Modified: trunk/Source/WTF/wtf/MemoryInstrumentation.h (130186 => 130187)


--- trunk/Source/WTF/wtf/MemoryInstrumentation.h	2012-10-02 17:53:38 UTC (rev 130186)
+++ trunk/Source/WTF/wtf/MemoryInstrumentation.h	2012-10-02 17:55:54 UTC (rev 130187)
@@ -329,6 +329,12 @@
 class CStringBuffer;
 void reportMemoryUsage(const CStringBuffer* const&, MemoryObjectInfo*);
 
+class ParsedURL;
+void reportMemoryUsage(const ParsedURL* const&, MemoryObjectInfo*);
+
+class URLString;
+void reportMemoryUsage(const URLString* const&, MemoryObjectInfo*);
+
 } // namespace WTF
 
 #endif // !defined(MemoryInstrumentation_h)

Added: trunk/Source/WTF/wtf/MemoryInstrumentationParsedURL.h (0 => 130187)


--- trunk/Source/WTF/wtf/MemoryInstrumentationParsedURL.h	                        (rev 0)
+++ trunk/Source/WTF/wtf/MemoryInstrumentationParsedURL.h	2012-10-02 17:55:54 UTC (rev 130187)
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+
+#ifndef MemoryInstrumentationParsedURL_h
+#define MemoryInstrumentationParsedURL_h
+
+#include <wtf/MemoryInstrumentation.h>
+#include <wtf/MemoryInstrumentationString.h>
+#include <wtf/url/api/ParsedURL.h>
+
+namespace WTF {
+
+inline void reportMemoryUsage(const URLString* const& urlString, MemoryObjectInfo* memoryObjectInfo)
+{
+    MemoryClassInfo info(memoryObjectInfo, urlString);
+    info.addMember(urlString->string());
+}
+
+inline void reportMemoryUsage(const ParsedURL* const& parsedURL, MemoryObjectInfo* memoryObjectInfo)
+{
+    MemoryClassInfo info(memoryObjectInfo, parsedURL);
+    info.addMember(arrayBuffer->spec());
+}
+
+}
+
+#endif // !defined(MemoryInstrumentationiParsedURL_h)

Modified: trunk/Source/WTF/wtf/text/AtomicString.cpp (130186 => 130187)


--- trunk/Source/WTF/wtf/text/AtomicString.cpp	2012-10-02 17:53:38 UTC (rev 130186)
+++ trunk/Source/WTF/wtf/text/AtomicString.cpp	2012-10-02 17:55:54 UTC (rev 130187)
@@ -26,7 +26,6 @@
 
 #include "StringHash.h"
 #include <wtf/HashSet.h>
-#include <wtf/MemoryInstrumentation.h>
 #include <wtf/Threading.h>
 #include <wtf/WTFThreadData.h>
 #include <wtf/unicode/UTF8.h>

Modified: trunk/Source/WTF/wtf/text/StringImpl.cpp (130186 => 130187)


--- trunk/Source/WTF/wtf/text/StringImpl.cpp	2012-10-02 17:53:38 UTC (rev 130186)
+++ trunk/Source/WTF/wtf/text/StringImpl.cpp	2012-10-02 17:55:54 UTC (rev 130187)
@@ -28,7 +28,6 @@
 #include "AtomicString.h"
 #include "StringBuffer.h"
 #include "StringHash.h"
-#include <wtf/MemoryInstrumentation.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/WTFThreadData.h>
 #include <wtf/unicode/CharacterNames.h>

Modified: trunk/Source/WTF/wtf/text/WTFString.cpp (130186 => 130187)


--- trunk/Source/WTF/wtf/text/WTFString.cpp	2012-10-02 17:53:38 UTC (rev 130186)
+++ trunk/Source/WTF/wtf/text/WTFString.cpp	2012-10-02 17:55:54 UTC (rev 130187)
@@ -28,7 +28,6 @@
 #include <wtf/DataLog.h>
 #include <wtf/HexNumber.h>
 #include <wtf/MathExtras.h>
-#include <wtf/MemoryInstrumentation.h>
 #include <wtf/text/CString.h>
 #include <wtf/StringExtras.h>
 #include <wtf/Vector.h>

Modified: trunk/Source/WTF/wtf/url/api/ParsedURL.cpp (130186 => 130187)


--- trunk/Source/WTF/wtf/url/api/ParsedURL.cpp	2012-10-02 17:53:38 UTC (rev 130186)
+++ trunk/Source/WTF/wtf/url/api/ParsedURL.cpp	2012-10-02 17:55:54 UTC (rev 130187)
@@ -30,7 +30,6 @@
 #if USE(WTFURL)
 
 #include <wtf/DataLog.h>
-#include <wtf/MemoryInstrumentation.h>
 #include <wtf/RawURLBuffer.h>
 #include <wtf/URLComponent.h>
 #include <wtf/URLUtil.h>
@@ -213,12 +212,6 @@
     return segment;
 }
 
-void ParsedURL::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
-{
-    MemoryClassInfo info(memoryObjectInfo, this);
-    info.addMember(m_spec);
-}
-
 #ifndef NDEBUG
 
 #define SHOW_COMPONENT(parsedURL, componentName) \

Modified: trunk/Source/WTF/wtf/url/api/ParsedURL.h (130186 => 130187)


--- trunk/Source/WTF/wtf/url/api/ParsedURL.h	2012-10-02 17:53:38 UTC (rev 130186)
+++ trunk/Source/WTF/wtf/url/api/ParsedURL.h	2012-10-02 17:55:54 UTC (rev 130187)
@@ -69,8 +69,6 @@
 
     const URLString& spec() { return m_spec; }
 
-    WTF_EXPORT_PRIVATE void reportMemoryUsage(MemoryObjectInfo*) const;
-
 #ifndef NDEBUG
     WTF_EXPORT_PRIVATE void print() const;
 #endif

Modified: trunk/Source/WTF/wtf/url/api/URLString.cpp (130186 => 130187)


--- trunk/Source/WTF/wtf/url/api/URLString.cpp	2012-10-02 17:53:38 UTC (rev 130186)
+++ trunk/Source/WTF/wtf/url/api/URLString.cpp	2012-10-02 17:55:54 UTC (rev 130187)
@@ -26,18 +26,10 @@
 #include "config.h"
 #include "URLString.h"
 
-#include <wtf/MemoryInstrumentation.h>
-
 #if USE(WTFURL)
 
 namespace WTF {
 
-void URLString::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
-{
-    MemoryClassInfo info(memoryObjectInfo, this);
-    info.addMember(m_string);
-}
-
 #ifndef NDEBUG
 void URLString::print() const
 {

Modified: trunk/Source/WTF/wtf/url/api/URLString.h (130186 => 130187)


--- trunk/Source/WTF/wtf/url/api/URLString.h	2012-10-02 17:53:38 UTC (rev 130186)
+++ trunk/Source/WTF/wtf/url/api/URLString.h	2012-10-02 17:55:54 UTC (rev 130187)
@@ -40,8 +40,6 @@
 
     const String& string() const { return m_string;}
 
-    void reportMemoryUsage(MemoryObjectInfo*) const;
-
 #ifndef NDEBUG
     WTF_EXPORT_PRIVATE void print() const;
 #endif

Modified: trunk/Source/WebCore/ChangeLog (130186 => 130187)


--- trunk/Source/WebCore/ChangeLog	2012-10-02 17:53:38 UTC (rev 130186)
+++ trunk/Source/WebCore/ChangeLog	2012-10-02 17:55:54 UTC (rev 130187)
@@ -1,3 +1,15 @@
+2012-10-02  Ilya Tikhonovsky  <loi...@chromium.org>
+
+        Web Inspector: NMI: switch to non intrusive instrumentation of ParsedURL.
+        https://bugs.webkit.org/show_bug.cgi?id=98150
+
+        Reviewed by Yury Semikhatsky.
+
+        Style changes.
+
+        * platform/KURLWTFURLImpl.h:
+        (WebCore::KURLWTFURLImpl::reportMemoryUsage):
+
 2012-10-02  Anders Carlsson  <ander...@apple.com>
 
         Add new GraphicsLayer::create overload to all ports

Modified: trunk/Source/WebCore/platform/KURLWTFURLImpl.h (130186 => 130187)


--- trunk/Source/WebCore/platform/KURLWTFURLImpl.h	2012-10-02 17:53:38 UTC (rev 130186)
+++ trunk/Source/WebCore/platform/KURLWTFURLImpl.h	2012-10-02 17:55:54 UTC (rev 130187)
@@ -29,6 +29,7 @@
 #if USE(WTFURL)
 
 #include "PlatformMemoryInstrumentation.h"
+#include <wtf/MemoryInstrumentationParsedURL.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
@@ -44,7 +45,7 @@
 
     void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     {
-        typename MemoryObjectInfo::ClassInfo info(memoryObjectInfo, this);
+        MemoryClassInfo info(memoryObjectInfo, this);
         info.addMember(m_parsedURL);
         info.addMember(m_invalidUrlString);
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to