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

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

Issue 528013002: Restore in-memory parser cache for V8 compile. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add unit tests. Created 6 years, 3 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) 2006 Samuel Weinig (sam.weinig@gmail.com) 4 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 6
7 This library is free software; you can redistribute it and/or 7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public 8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either 9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version. 10 version 2 of the License, or (at your option) any later version.
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 virtual void responseReceived(const ResourceResponse&); 188 virtual void responseReceived(const ResourceResponse&);
189 void setResponse(const ResourceResponse& response) { m_response = response; } 189 void setResponse(const ResourceResponse& response) { m_response = response; }
190 const ResourceResponse& response() const { return m_response; } 190 const ResourceResponse& response() const { return m_response; }
191 191
192 // Sets the serialized metadata retrieved from the platform's cache. 192 // Sets the serialized metadata retrieved from the platform's cache.
193 void setSerializedCachedMetadata(const char*, size_t); 193 void setSerializedCachedMetadata(const char*, size_t);
194 194
195 // Caches the given metadata in association with this resource and suggests 195 // Caches the given metadata in association with this resource and suggests
196 // that the platform persist it. The dataTypeID is a pseudo-randomly chosen 196 // that the platform persist it. The dataTypeID is a pseudo-randomly chosen
197 // identifier that is used to distinguish data generated by the caller. 197 // identifier that is used to distinguish data generated by the caller.
198 void setCachedMetadata(unsigned dataTypeID, const char*, size_t); 198 // If persist is set, this will be sent to Platform::cacheMetadata for
199 // persistent caching by the embedder. Otherwise the caching is only
200 // in memory and therefore in-process.
201 void setCachedMetadata(unsigned dataTypeID, const char*, size_t, bool persis t = true);
jochen (gone - plz use gerrit) 2014/09/05 11:48:04 is it possible to use a enum instead of the bool?
vogelheim 2014/09/05 11:54:12 Hm. Yes, but why? I don't understand the benefit.
jochen (gone - plz use gerrit) 2014/09/05 14:05:40 so the callsites are easier to read "setCachedMeta
vogelheim 2014/09/05 14:49:01 Done. I called it CacheLocally and SendToPlatform
199 202
200 // Reset existing metadata, to allow setting new data. 203 // Reset existing metadata, to allow setting new data.
201 void clearCachedMetadata(); 204 void clearCachedMetadata();
202 205
203 // Returns cached metadata of the given type associated with this resource. 206 // Returns cached metadata of the given type associated with this resource.
204 CachedMetadata* cachedMetadata(unsigned dataTypeID) const; 207 CachedMetadata* cachedMetadata(unsigned dataTypeID) const;
205 208
206 bool hasOneHandle() const; 209 bool hasOneHandle() const;
207 bool canDelete() const; 210 bool canDelete() const;
208 211
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 const char* ResourceTypeName(Resource::Type); 414 const char* ResourceTypeName(Resource::Type);
412 #endif 415 #endif
413 416
414 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 417 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
415 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() = = Resource::typeName, resource.type() == Resource::typeName); \ 418 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() = = Resource::typeName, resource.type() == Resource::typeName); \
416 inline typeName##Resource* to##typeName##Resource(const ResourcePtr<Resource >& ptr) { return to##typeName##Resource(ptr.get()); } 419 inline typeName##Resource* to##typeName##Resource(const ResourcePtr<Resource >& ptr) { return to##typeName##Resource(ptr.get()); }
417 420
418 } 421 }
419 422
420 #endif 423 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698