Changeset 125763 in webkit
- Timestamp:
- Aug 16, 2012 2:18:34 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r125761 r125763 1 2012-08-16 Yury Semikhatsky <yurys@chromium.org> 2 3 Web Inspector: memory instrumentation for Resource{Request/Response}Base 4 https://bugs.webkit.org/show_bug.cgi?id=94109 5 6 Reviewed by Vsevolod Vlasov. 7 8 Added reportMemoryUsage methods to ResourceRequestBase, ResourceResponseBase 9 and several related classes. 10 11 * dom/MemoryInstrumentation.cpp: 12 (WebCore::MemoryInstrumentation::addInstrumentedObjectImpl): added overrides 13 for String, StringImpl and AtomicString object types so that we can reuse 14 existing addInstrumentedCollection method instead of adding a counterpart 15 that would operate on not instrumented content. Next step would be to get 16 rid od addObject overrides for these types so that all kinds of Strings are 17 considered as instrumented classes despite they don't have reportMemoryUsage 18 method. 19 (WebCore): 20 * dom/MemoryInstrumentation.h: 21 (WebCore::MemoryInstrumentation::addInstrumentedObjectImpl): 22 (MemoryInstrumentation): 23 * loader/DocumentLoader.cpp: 24 (WebCore::DocumentLoader::reportMemoryUsage): 25 * platform/network/FormData.cpp: 26 (WebCore::FormData::reportMemoryUsage): 27 (WebCore): 28 * platform/network/FormData.h: 29 (WebCore): 30 (FormData): 31 * platform/network/ResourceRequestBase.cpp: 32 (WebCore::ResourceRequestBase::reportMemoryUsage): 33 (WebCore): 34 * platform/network/ResourceRequestBase.h: 35 (ResourceRequestBase): 36 * platform/network/ResourceResponseBase.cpp: 37 (WebCore): 38 (WebCore::ResourceResponseBase::reportMemoryUsage): 39 * platform/network/ResourceResponseBase.h: 40 (WebCore): 41 (ResourceResponseBase): 42 1 43 2012-08-16 Adam Barth <abarth@webkit.org> 2 44 -
trunk/Source/WebCore/dom/MemoryInstrumentation.cpp
r125265 r125763 59 59 } 60 60 61 void MemoryInstrumentation::addInstrumentedObjectImpl(const AtomicString* const& string, ObjectType objectType, OwningType) 62 { 63 addObject(static_cast<const String&>(*string), objectType); 64 } 65 61 66 } // namespace WebCore -
trunk/Source/WebCore/dom/MemoryInstrumentation.h
r125265 r125763 138 138 }; 139 139 140 // FIXME: get rid of addObject(String) 141 void addInstrumentedObjectImpl(const String* const& string, ObjectType objectType, OwningType) { addObject(*string, objectType); } 142 void addInstrumentedObjectImpl(const StringImpl* const& string, ObjectType objectType, OwningType) { addObject(string, objectType); } 143 void addInstrumentedObjectImpl(const AtomicString* const&, ObjectType, OwningType); 140 144 template <typename T> void addInstrumentedObjectImpl(const T* const&, ObjectType, OwningType); 141 145 template <typename T> void addInstrumentedObjectImpl(const DataRef<T>* const&, ObjectType, OwningType); -
trunk/Source/WebCore/loader/DocumentLoader.cpp
r125615 r125763 364 364 info.addInstrumentedHashSet(m_multipartSubresourceLoaders); 365 365 info.addInstrumentedHashSet(m_plugInStreamLoaders); 366 info.addInstrumentedMember(m_substituteData); 366 367 info.addMember(m_pageTitle.string()); 367 368 info.addMember(m_overrideEncoding); 368 369 info.addVector(m_responses); 370 info.addInstrumentedMember(m_originalRequest); 371 info.addInstrumentedMember(m_originalRequestCopy); 372 info.addInstrumentedMember(m_request); 373 info.addInstrumentedMember(m_response); 374 info.addInstrumentedMember(m_lastCheckedRequest); 375 info.addInstrumentedVector(m_responses); 369 376 info.addHashMap(m_pendingSubstituteResources); 370 info.add HashSet(m_resourcesClientKnowsAbout);377 info.addInstrumentedHashSet(m_resourcesClientKnowsAbout); 371 378 info.addVector(m_resourcesLoadedFromMemoryCacheForClientNotification); 372 379 info.addMember(m_clientRedirectSourceForHistory); -
trunk/Source/WebCore/platform/network/FormData.cpp
r125391 r125763 33 33 #include "FormDataList.h" 34 34 #include "MIMETypeRegistry.h" 35 #include "MemoryInstrumentation.h" 35 36 #include "Page.h" 36 37 #include "TextEncoding.h" … … 357 358 } 358 359 360 void FormData::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 361 { 362 MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::Loader); 363 info.addVector(m_boundary); 364 } 365 359 366 static void encode(Encoder& encoder, const FormDataElement& element) 360 367 { -
trunk/Source/WebCore/platform/network/FormData.h
r125391 r125763 31 31 class Document; 32 32 class FormDataList; 33 class MemoryObjectInfo; 33 34 class TextEncoding; 34 35 … … 153 154 void setContainsPasswordData(bool containsPasswordData) { m_containsPasswordData = containsPasswordData; } 154 155 156 void reportMemoryUsage(MemoryObjectInfo*) const; 157 155 158 static EncodingType parseEncodingType(const String& type) 156 159 { -
trunk/Source/WebCore/platform/network/ResourceRequestBase.cpp
r112555 r125763 25 25 */ 26 26 #include "config.h" 27 28 27 #include "ResourceRequestBase.h" 28 29 #include "MemoryInstrumentation.h" 29 30 #include "ResourceRequest.h" 30 31 … … 444 445 } 445 446 447 void ResourceRequestBase::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 448 { 449 MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::Loader); 450 info.addMember(m_url); 451 info.addMember(m_firstPartyForCookies); 452 info.addInstrumentedMember(m_httpMethod); 453 info.addHashMap(m_httpHeaderFields); 454 info.addInstrumentedMapEntries(m_httpHeaderFields); 455 info.addInstrumentedVector(m_responseContentDispositionEncodingFallbackArray); 456 info.addInstrumentedMember(m_httpBody); 457 } 458 446 459 double ResourceRequestBase::defaultTimeoutInterval() 447 460 { -
trunk/Source/WebCore/platform/network/ResourceRequestBase.h
r112217 r125763 45 45 }; 46 46 47 class MemoryObjectInfo; 47 48 class ResourceRequest; 48 49 struct CrossThreadResourceRequestData; … … 132 133 bool reportRawHeaders() const { return m_reportRawHeaders; } 133 134 void setReportRawHeaders(bool reportRawHeaders) { m_reportRawHeaders = reportRawHeaders; } 135 136 void reportMemoryUsage(MemoryObjectInfo*) const; 134 137 135 138 static double defaultTimeoutInterval(); // May return 0 when using platform default. -
trunk/Source/WebCore/platform/network/ResourceResponseBase.cpp
r115290 r125763 29 29 30 30 #include "HTTPParsers.h" 31 #include "MemoryInstrumentation.h" 31 32 #include "ResourceResponse.h" 32 33 #include <wtf/CurrentTime.h> … … 566 567 { 567 568 const_cast<ResourceResponse*>(static_cast<const ResourceResponse*>(this))->platformLazyInit(initLevel); 569 } 570 571 void ResourceResponseBase::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 572 { 573 MemoryClassInfo info(memoryObjectInfo, this, MemoryInstrumentation::Loader); 574 info.addMember(m_url); 575 info.addInstrumentedMember(m_mimeType); 576 info.addInstrumentedMember(m_textEncodingName); 577 info.addInstrumentedMember(m_suggestedFilename); 578 info.addInstrumentedMember(m_httpStatusText); 579 info.addHashMap(m_httpHeaderFields); 580 info.addInstrumentedMapEntries(m_httpHeaderFields); 581 info.addMember(m_resourceLoadTiming); 582 info.addMember(m_resourceLoadInfo); 568 583 } 569 584 -
trunk/Source/WebCore/platform/network/ResourceResponseBase.h
r87460 r125763 42 42 namespace WebCore { 43 43 44 class MemoryObjectInfo; 44 45 class ResourceResponse; 45 46 struct CrossThreadResourceResponseData; … … 126 127 return 1280; 127 128 } 129 130 void reportMemoryUsage(MemoryObjectInfo*) const; 128 131 129 132 static bool compare(const ResourceResponse&, const ResourceResponse&);
Note: See TracChangeset
for help on using the changeset viewer.