Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1248)

Side by Side Diff: Source/core/fetch/Resource.cpp

Issue 1228833004: Oilpan: Move CachedMetadataHandler to Oilpan heap on Oilpan-enabled world. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 if (header.startsWith(headerPrefixesToIgnoreAfterRevalidation[i], TextCa seInsensitive)) 89 if (header.startsWith(headerPrefixesToIgnoreAfterRevalidation[i], TextCa seInsensitive))
90 return false; 90 return false;
91 } 91 }
92 return true; 92 return true;
93 } 93 }
94 94
95 DEFINE_DEBUG_ONLY_GLOBAL(RefCountedLeakCounter, cachedResourceLeakCounter, ("Res ource")); 95 DEFINE_DEBUG_ONLY_GLOBAL(RefCountedLeakCounter, cachedResourceLeakCounter, ("Res ource"));
96 96
97 class Resource::CacheHandler : public CachedMetadataHandler { 97 class Resource::CacheHandler : public CachedMetadataHandler {
98 public: 98 public:
99 static PassOwnPtr<CacheHandler> create(Resource* resource) 99 static PassOwnPtrWillBeRawPtr<CacheHandler> create(Resource* resource)
100 { 100 {
101 return adoptPtr(new CacheHandler(resource)); 101 return adoptPtrWillBeNoop(new CacheHandler(resource));
102 } 102 }
103 ~CacheHandler() override { } 103 ~CacheHandler() override { }
104 #if ENABLE(OILPAN)
105 DECLARE_VIRTUAL_TRACE();
106 #endif
104 void setCachedMetadata(unsigned, const char*, size_t, CacheType) override; 107 void setCachedMetadata(unsigned, const char*, size_t, CacheType) override;
105 void clearCachedMetadata(CacheType) override; 108 void clearCachedMetadata(CacheType) override;
106 CachedMetadata* cachedMetadata(unsigned) const override; 109 CachedMetadata* cachedMetadata(unsigned) const override;
107 String encoding() const override; 110 String encoding() const override;
108 111
109 private: 112 private:
110 explicit CacheHandler(Resource*); 113 explicit CacheHandler(Resource*);
111 Resource* m_resource; 114 RawPtrWillBeMember<Resource> m_resource;
112 }; 115 };
113 116
114 Resource::CacheHandler::CacheHandler(Resource* resource) 117 Resource::CacheHandler::CacheHandler(Resource* resource)
115 : m_resource(resource) 118 : m_resource(resource)
116 { 119 {
117 } 120 }
118 121
122 #if ENABLE(OILPAN)
123 DEFINE_TRACE(Resource::CacheHandler)
124 {
125 visitor->trace(m_resource);
126 CachedMetadataHandler::trace(visitor);
127 }
128 #endif
129
119 void Resource::CacheHandler::setCachedMetadata(unsigned dataTypeID, const char* data, size_t size, CacheType type) 130 void Resource::CacheHandler::setCachedMetadata(unsigned dataTypeID, const char* data, size_t size, CacheType type)
120 { 131 {
121 m_resource->setCachedMetadata(dataTypeID, data, size, type); 132 m_resource->setCachedMetadata(dataTypeID, data, size, type);
122 } 133 }
123 134
124 void Resource::CacheHandler::clearCachedMetadata(CacheType type) 135 void Resource::CacheHandler::clearCachedMetadata(CacheType type)
125 { 136 {
126 m_resource->clearCachedMetadata(type); 137 m_resource->clearCachedMetadata(type);
127 } 138 }
128 139
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 212
202 void Resource::dispose() 213 void Resource::dispose()
203 { 214 {
204 } 215 }
205 216
206 DEFINE_TRACE(Resource) 217 DEFINE_TRACE(Resource)
207 { 218 {
208 visitor->trace(m_loader); 219 visitor->trace(m_loader);
209 visitor->trace(m_resourceToRevalidate); 220 visitor->trace(m_resourceToRevalidate);
210 visitor->trace(m_proxyResource); 221 visitor->trace(m_proxyResource);
222 #if ENABLE(OILPAN)
223 visitor->trace(m_cacheHandler);
224 #endif
211 } 225 }
212 226
213 void Resource::load(ResourceFetcher* fetcher, const ResourceLoaderOptions& optio ns) 227 void Resource::load(ResourceFetcher* fetcher, const ResourceLoaderOptions& optio ns)
214 { 228 {
215 m_options = options; 229 m_options = options;
216 m_loading = true; 230 m_loading = true;
217 231
218 if (!accept().isEmpty()) 232 if (!accept().isEmpty())
219 m_resourceRequest.setHTTPAccept(accept()); 233 m_resourceRequest.setHTTPAccept(accept());
220 234
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
1078 return "ImportResource"; 1092 return "ImportResource";
1079 case Resource::Media: 1093 case Resource::Media:
1080 return "Media"; 1094 return "Media";
1081 } 1095 }
1082 ASSERT_NOT_REACHED(); 1096 ASSERT_NOT_REACHED();
1083 return "Unknown"; 1097 return "Unknown";
1084 } 1098 }
1085 #endif // !LOG_DISABLED 1099 #endif // !LOG_DISABLED
1086 1100
1087 } // namespace blink 1101 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698