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

Side by Side Diff: third_party/WebKit/Source/core/fetch/CachedMetadataHandler.h

Issue 2258743002: Reserve Vector's capacity manually in CachedMetadata (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CachedMetadataHandler_h 5 #ifndef CachedMetadataHandler_h
6 #define CachedMetadataHandler_h 6 #define CachedMetadataHandler_h
7 7
8 #include "platform/heap/Handle.h" 8 #include "platform/heap/Handle.h"
9 #include "wtf/Forward.h" 9 #include "wtf/Forward.h"
10 #include <stdint.h>
10 11
11 namespace blink { 12 namespace blink {
12 13
13 class CachedMetadata; 14 class CachedMetadata;
14 15
15 // Handler class for caching operations. 16 // Handler class for caching operations.
16 class CachedMetadataHandler : public GarbageCollectedFinalized<CachedMetadataHan dler> { 17 class CachedMetadataHandler : public GarbageCollectedFinalized<CachedMetadataHan dler> {
17 public: 18 public:
18 enum CacheType { 19 enum CacheType {
19 SendToPlatform, // send cache data to blink::Platform::cacheMetadata 20 SendToPlatform, // send cache data to blink::Platform::cacheMetadata
20 CacheLocally // cache only in Resource's member variables 21 CacheLocally // cache only in Resource's member variables
21 }; 22 };
22 virtual ~CachedMetadataHandler() { } 23 virtual ~CachedMetadataHandler() { }
23 DEFINE_INLINE_VIRTUAL_TRACE() { } 24 DEFINE_INLINE_VIRTUAL_TRACE() { }
24 // Caches the given metadata in association with this resource and suggests 25 // Caches the given metadata in association with this resource and suggests
25 // that the platform persist it. The dataTypeID is a pseudo-randomly chosen 26 // that the platform persist it. The dataTypeID is a pseudo-randomly chosen
26 // identifier that is used to distinguish data generated by the caller. 27 // identifier that is used to distinguish data generated by the caller.
27 virtual void setCachedMetadata(unsigned dataTypeID, const char*, size_t, Cac heType = SendToPlatform) = 0; 28 virtual void setCachedMetadata(uint32_t dataTypeID, const char*, size_t, Cac heType = SendToPlatform) = 0;
28 // Reset existing metadata, to allow setting new data. 29 // Reset existing metadata, to allow setting new data.
29 virtual void clearCachedMetadata(CacheType = CacheLocally) = 0; 30 virtual void clearCachedMetadata(CacheType = CacheLocally) = 0;
30 // Returns cached metadata of the given type associated with this resource. 31 // Returns cached metadata of the given type associated with this resource.
31 // This cached metadata can be pruned at any time. 32 // This cached metadata can be pruned at any time.
32 virtual PassRefPtr<CachedMetadata> cachedMetadata(unsigned dataTypeID) const = 0; 33 virtual PassRefPtr<CachedMetadata> cachedMetadata(uint32_t dataTypeID) const = 0;
33 // Returns the encoding to which the cache is specific. 34 // Returns the encoding to which the cache is specific.
34 virtual String encoding() const = 0; 35 virtual String encoding() const = 0;
35 36
36 protected: 37 protected:
37 CachedMetadataHandler() { } 38 CachedMetadataHandler() { }
38 }; 39 };
39 } // namespace blink 40 } // namespace blink
40 41
41 #endif // CachedMetadataHandler_h 42 #endif // CachedMetadataHandler_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/CachedMetadata.cpp ('k') | third_party/WebKit/Source/core/fetch/Resource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698