OLD | NEW |
1 /* | 1 /* |
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. | 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
rights reserved. |
7 | 7 |
8 This library is free software; you can redistribute it and/or | 8 This library is free software; you can redistribute it and/or |
9 modify it under the terms of the GNU Library General Public | 9 modify it under the terms of the GNU Library General Public |
10 License as published by the Free Software Foundation; either | 10 License as published by the Free Software Foundation; either |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "FrameLoaderClient.h" | 37 #include "FrameLoaderClient.h" |
38 #include "InspectorInstrumentation.h" | 38 #include "InspectorInstrumentation.h" |
39 #include "KURL.h" | 39 #include "KURL.h" |
40 #include "Logging.h" | 40 #include "Logging.h" |
41 #include "PurgeableBuffer.h" | 41 #include "PurgeableBuffer.h" |
42 #include "ResourceHandle.h" | 42 #include "ResourceHandle.h" |
43 #include "SecurityOrigin.h" | 43 #include "SecurityOrigin.h" |
44 #include "SecurityPolicy.h" | 44 #include "SecurityPolicy.h" |
45 #include "SharedBuffer.h" | 45 #include "SharedBuffer.h" |
46 #include "ResourceLoader.h" | 46 #include "ResourceLoader.h" |
47 #include "WebCoreMemoryInstrumentation.h" | |
48 #include <wtf/CurrentTime.h> | 47 #include <wtf/CurrentTime.h> |
49 #include <wtf/MathExtras.h> | 48 #include <wtf/MathExtras.h> |
50 #include <wtf/MemoryInstrumentationHashCountedSet.h> | |
51 #include <wtf/MemoryInstrumentationHashSet.h> | |
52 #include <wtf/MemoryObjectInfo.h> | |
53 #include <wtf/RefCountedLeakCounter.h> | 49 #include <wtf/RefCountedLeakCounter.h> |
54 #include <wtf/StdLibExtras.h> | 50 #include <wtf/StdLibExtras.h> |
55 #include <wtf/text/CString.h> | 51 #include <wtf/text/CString.h> |
56 #include <wtf/Vector.h> | 52 #include <wtf/Vector.h> |
57 | 53 |
58 namespace WTF { | |
59 | |
60 template<> struct SequenceMemoryInstrumentationTraits<WebCore::CachedResourceCli
ent*> { | |
61 template <typename I> static void reportMemoryUsage(I, I, MemoryClassInfo&)
{ } | |
62 }; | |
63 | |
64 } | |
65 | |
66 using namespace WTF; | 54 using namespace WTF; |
67 | 55 |
68 namespace WebCore { | 56 namespace WebCore { |
69 | 57 |
70 // These response headers are not copied from a revalidated response to the | 58 // These response headers are not copied from a revalidated response to the |
71 // cached response headers. For compatibility, this list is based on Chromium's | 59 // cached response headers. For compatibility, this list is based on Chromium's |
72 // net/http/http_response_headers.cc. | 60 // net/http/http_response_headers.cc. |
73 const char* const headersToIgnoreAfterRevalidation[] = { | 61 const char* const headersToIgnoreAfterRevalidation[] = { |
74 "allow", | 62 "allow", |
75 "connection", | 63 "connection", |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 { | 901 { |
914 if (m_callbackTimer.isActive()) | 902 if (m_callbackTimer.isActive()) |
915 m_callbackTimer.stop(); | 903 m_callbackTimer.stop(); |
916 } | 904 } |
917 | 905 |
918 void CachedResource::CachedResourceCallback::timerFired(Timer<CachedResourceCall
back>*) | 906 void CachedResource::CachedResourceCallback::timerFired(Timer<CachedResourceCall
back>*) |
919 { | 907 { |
920 m_resource->didAddClient(m_client); | 908 m_resource->didAddClient(m_client); |
921 } | 909 } |
922 | 910 |
923 void CachedResource::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const | |
924 { | |
925 MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CachedResou
rce); | |
926 memoryObjectInfo->setName(url().string().utf8().data()); | |
927 info.addMember(m_resourceRequest, "resourceRequest"); | |
928 info.addMember(m_fragmentIdentifierForRequest, "fragmentIdentifierForRequest
"); | |
929 info.addMember(m_clients, "clients"); | |
930 info.addMember(m_accept, "accept"); | |
931 info.addMember(m_loader, "loader"); | |
932 info.addMember(m_response, "response"); | |
933 info.addMember(m_data, "data"); | |
934 info.addMember(m_cachedMetadata, "cachedMetadata"); | |
935 info.addMember(m_nextInAllResourcesList, "nextInAllResourcesList"); | |
936 info.addMember(m_prevInAllResourcesList, "prevInAllResourcesList"); | |
937 info.addMember(m_nextInLiveResourcesList, "nextInLiveResourcesList"); | |
938 info.addMember(m_prevInLiveResourcesList, "prevInLiveResourcesList"); | |
939 info.addMember(m_owningCachedResourceLoader, "owningCachedResourceLoader"); | |
940 info.addMember(m_resourceToRevalidate, "resourceToRevalidate"); | |
941 info.addMember(m_proxyResource, "proxyResource"); | |
942 info.addMember(m_handlesToRevalidate, "handlesToRevalidate"); | |
943 info.addMember(m_options, "options"); | |
944 info.addMember(m_decodedDataDeletionTimer, "decodedDataDeletionTimer"); | |
945 info.ignoreMember(m_clientsAwaitingCallback); | |
946 | |
947 if (m_purgeableData && !m_purgeableData->wasPurged()) | |
948 info.addRawBuffer(m_purgeableData.get(), m_purgeableData->size(), "Purge
ableData", "purgeableData"); | |
949 } | 911 } |
950 } | |
OLD | NEW |