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

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

Issue 1738623004: Rename enums/functions that collide in chromium style. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@get-names-4
Patch Set: get-names-5: rebase-and-stuff Created 4 years, 9 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 unsigned long identifier() const { return m_identifier; } 120 unsigned long identifier() const { return m_identifier; }
121 121
122 virtual bool shouldIgnoreHTTPStatusCodeErrors() const { return false; } 122 virtual bool shouldIgnoreHTTPStatusCodeErrors() const { return false; }
123 123
124 const ResourceRequest& resourceRequest() const { return m_resourceRequest; } 124 const ResourceRequest& resourceRequest() const { return m_resourceRequest; }
125 const ResourceRequest& lastResourceRequest() const; 125 const ResourceRequest& lastResourceRequest() const;
126 126
127 void setRevalidatingRequest(const ResourceRequest& request) { m_revalidating Request = request; } 127 void setRevalidatingRequest(const ResourceRequest& request) { m_revalidating Request = request; }
128 128
129 const KURL& url() const { return m_resourceRequest.url();} 129 const KURL& url() const { return m_resourceRequest.url();}
130 Type type() const { return static_cast<Type>(m_type); } 130 Type getType() const { return static_cast<Type>(m_type); }
131 const ResourceLoaderOptions& options() const { return m_options; } 131 const ResourceLoaderOptions& options() const { return m_options; }
132 void setOptions(const ResourceLoaderOptions& options) { m_options = options; } 132 void setOptions(const ResourceLoaderOptions& options) { m_options = options; }
133 133
134 void didChangePriority(ResourceLoadPriority, int intraPriorityValue); 134 void didChangePriority(ResourceLoadPriority, int intraPriorityValue);
135 ResourcePriority priorityFromClients(); 135 ResourcePriority priorityFromClients();
136 136
137 void addClient(ResourceClient*); 137 void addClient(ResourceClient*);
138 void removeClient(ResourceClient*); 138 void removeClient(ResourceClient*);
139 bool hasClients() const { return !m_clients.isEmpty() || !m_clientsAwaitingC allback.isEmpty() || !m_finishedClients.isEmpty(); } 139 bool hasClients() const { return !m_clients.isEmpty() || !m_clientsAwaitingC allback.isEmpty() || !m_finishedClients.isEmpty(); }
140 140
141 enum PreloadResult { 141 enum PreloadResult {
142 PreloadNotReferenced, 142 PreloadNotReferenced,
143 PreloadReferenced, 143 PreloadReferenced,
144 PreloadReferencedWhileLoading, 144 PreloadReferencedWhileLoading,
145 PreloadReferencedWhileComplete 145 PreloadReferencedWhileComplete
146 }; 146 };
147 PreloadResult preloadResult() const { return static_cast<PreloadResult>(m_pr eloadResult); } 147 PreloadResult getPreloadResult() const { return static_cast<PreloadResult>(m _preloadResult); }
148 148
149 virtual void didAddClient(ResourceClient*); 149 virtual void didAddClient(ResourceClient*);
150 virtual void didRemoveClient(ResourceClient*) { } 150 virtual void didRemoveClient(ResourceClient*) { }
151 virtual void allClientsRemoved(); 151 virtual void allClientsRemoved();
152 152
153 unsigned count() const { return m_clients.size(); } 153 unsigned count() const { return m_clients.size(); }
154 154
155 Status status() const { return static_cast<Status>(m_status); } 155 Status getStatus() const { return static_cast<Status>(m_status); }
156 void setStatus(Status status) { m_status = status; } 156 void setStatus(Status status) { m_status = status; }
157 157
158 size_t size() const { return encodedSize() + decodedSize() + overheadSize(); } 158 size_t size() const { return encodedSize() + decodedSize() + overheadSize(); }
159 size_t encodedSize() const { return m_encodedSize; } 159 size_t encodedSize() const { return m_encodedSize; }
160 size_t decodedSize() const { return m_decodedSize; } 160 size_t decodedSize() const { return m_decodedSize; }
161 size_t overheadSize() const; 161 size_t overheadSize() const;
162 162
163 bool isLoaded() const { return !m_loading; } // FIXME. Method name is inaccu rate. Loading might not have started yet. 163 bool isLoaded() const { return !m_loading; } // FIXME. Method name is inaccu rate. Loading might not have started yet.
164 164
165 bool isLoading() const { return m_loading; } 165 bool isLoading() const { return m_loading; }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 // A MIME type may contain a wildcard, e.g. "text/*". 209 // A MIME type may contain a wildcard, e.g. "text/*".
210 AtomicString accept() const { return m_accept; } 210 AtomicString accept() const { return m_accept; }
211 void setAccept(const AtomicString& accept) { m_accept = accept; } 211 void setAccept(const AtomicString& accept) { m_accept = accept; }
212 212
213 AtomicString httpContentType() const; 213 AtomicString httpContentType() const;
214 214
215 bool wasCanceled() const { return m_error.isCancellation(); } 215 bool wasCanceled() const { return m_error.isCancellation(); }
216 bool errorOccurred() const { return m_status == LoadError || m_status == Dec odeError; } 216 bool errorOccurred() const { return m_status == LoadError || m_status == Dec odeError; }
217 bool loadFailedOrCanceled() { return !m_error.isNull(); } 217 bool loadFailedOrCanceled() { return !m_error.isNull(); }
218 218
219 DataBufferingPolicy dataBufferingPolicy() const { return m_options.dataBuffe ringPolicy; } 219 DataBufferingPolicy getDataBufferingPolicy() const { return m_options.dataBu fferingPolicy; }
220 void setDataBufferingPolicy(DataBufferingPolicy); 220 void setDataBufferingPolicy(DataBufferingPolicy);
221 221
222 bool isUnusedPreload() const { return isPreloaded() && preloadResult() == Pr eloadNotReferenced; } 222 bool isUnusedPreload() const { return isPreloaded() && getPreloadResult() == PreloadNotReferenced; }
223 bool isPreloaded() const { return m_preloadCount; } 223 bool isPreloaded() const { return m_preloadCount; }
224 void increasePreloadCount() { ++m_preloadCount; } 224 void increasePreloadCount() { ++m_preloadCount; }
225 void decreasePreloadCount() { ASSERT(m_preloadCount); --m_preloadCount; } 225 void decreasePreloadCount() { ASSERT(m_preloadCount); --m_preloadCount; }
226 226
227 bool canReuseRedirectChain(); 227 bool canReuseRedirectChain();
228 bool mustRevalidateDueToCacheHeaders(); 228 bool mustRevalidateDueToCacheHeaders();
229 bool canUseCacheValidator(); 229 bool canUseCacheValidator();
230 bool isCacheValidator() const { return !m_revalidatingRequest.isNull(); } 230 bool isCacheValidator() const { return !m_revalidatingRequest.isNull(); }
231 bool hasCacheControlNoStoreHeader(); 231 bool hasCacheControlNoStoreHeader();
232 bool hasVaryHeader() const; 232 bool hasVaryHeader() const;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 virtual PassRefPtrWillBeRawPtr<Resource> create(const ResourceRequest&, cons t String&) const = 0; 393 virtual PassRefPtrWillBeRawPtr<Resource> create(const ResourceRequest&, cons t String&) const = 0;
394 Resource::Type type() const { return m_type; } 394 Resource::Type type() const { return m_type; }
395 395
396 protected: 396 protected:
397 ResourceFactory(Resource::Type type) : m_type(type) { } 397 ResourceFactory(Resource::Type type) : m_type(type) { }
398 398
399 Resource::Type m_type; 399 Resource::Type m_type;
400 }; 400 };
401 401
402 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 402 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
403 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() = = Resource::typeName, resource.type() == Resource::typeName); \ 403 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType( ) == Resource::typeName, resource.getType() == Resource::typeName); \
404 inline typeName##Resource* to##typeName##Resource(const RefPtrWillBeRawPtr<R esource>& ptr) { return to##typeName##Resource(ptr.get()); } 404 inline typeName##Resource* to##typeName##Resource(const RefPtrWillBeRawPtr<R esource>& ptr) { return to##typeName##Resource(ptr.get()); }
405 405
406 } // namespace blink 406 } // namespace blink
407 407
408 #endif 408 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/RawResource.h ('k') | third_party/WebKit/Source/core/fetch/Resource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698