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

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 Created 4 years, 10 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 // List of acceptable MIME types separated by ",". 208 // List of acceptable MIME types separated by ",".
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 bool wasCanceled() const { return m_error.isCancellation(); } 213 bool wasCanceled() const { return m_error.isCancellation(); }
214 bool errorOccurred() const { return m_status == LoadError || m_status == Dec odeError; } 214 bool errorOccurred() const { return m_status == LoadError || m_status == Dec odeError; }
215 bool loadFailedOrCanceled() { return !m_error.isNull(); } 215 bool loadFailedOrCanceled() { return !m_error.isNull(); }
216 216
217 DataBufferingPolicy dataBufferingPolicy() const { return m_options.dataBuffe ringPolicy; } 217 DataBufferingPolicy getDataBufferingPolicy() const { return m_options.dataBu fferingPolicy; }
218 void setDataBufferingPolicy(DataBufferingPolicy); 218 void setDataBufferingPolicy(DataBufferingPolicy);
219 219
220 bool isUnusedPreload() const { return isPreloaded() && preloadResult() == Pr eloadNotReferenced; } 220 bool isUnusedPreload() const { return isPreloaded() && getPreloadResult() == PreloadNotReferenced; }
221 bool isPreloaded() const { return m_preloadCount; } 221 bool isPreloaded() const { return m_preloadCount; }
222 void increasePreloadCount() { ++m_preloadCount; } 222 void increasePreloadCount() { ++m_preloadCount; }
223 void decreasePreloadCount() { ASSERT(m_preloadCount); --m_preloadCount; } 223 void decreasePreloadCount() { ASSERT(m_preloadCount); --m_preloadCount; }
224 224
225 bool canReuseRedirectChain(); 225 bool canReuseRedirectChain();
226 bool mustRevalidateDueToCacheHeaders(); 226 bool mustRevalidateDueToCacheHeaders();
227 bool canUseCacheValidator(); 227 bool canUseCacheValidator();
228 bool isCacheValidator() const { return !m_revalidatingRequest.isNull(); } 228 bool isCacheValidator() const { return !m_revalidatingRequest.isNull(); }
229 bool hasCacheControlNoStoreHeader(); 229 bool hasCacheControlNoStoreHeader();
230 bool hasVaryHeader() const; 230 bool hasVaryHeader() const;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 virtual PassRefPtrWillBeRawPtr<Resource> create(const ResourceRequest&, cons t String&) const = 0; 391 virtual PassRefPtrWillBeRawPtr<Resource> create(const ResourceRequest&, cons t String&) const = 0;
392 Resource::Type type() const { return m_type; } 392 Resource::Type type() const { return m_type; }
393 393
394 protected: 394 protected:
395 ResourceFactory(Resource::Type type) : m_type(type) { } 395 ResourceFactory(Resource::Type type) : m_type(type) { }
396 396
397 Resource::Type m_type; 397 Resource::Type m_type;
398 }; 398 };
399 399
400 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 400 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
401 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->type() = = Resource::typeName, resource.type() == Resource::typeName); \ 401 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType( ) == Resource::typeName, resource.getType() == Resource::typeName); \
402 inline typeName##Resource* to##typeName##Resource(const RefPtrWillBeRawPtr<R esource>& ptr) { return to##typeName##Resource(ptr.get()); } 402 inline typeName##Resource* to##typeName##Resource(const RefPtrWillBeRawPtr<R esource>& ptr) { return to##typeName##Resource(ptr.get()); }
403 403
404 } // namespace blink 404 } // namespace blink
405 405
406 #endif 406 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698