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

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

Issue 2210473002: Mark ResourceClient/ImageResourceObserver finished just before notifying (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reflect comments Created 4 years, 4 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 242
243 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail, WebProcessMemoryDump*) const; 243 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail, WebProcessMemoryDump*) const;
244 244
245 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&); 245 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&);
246 246
247 protected: 247 protected:
248 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&); 248 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&);
249 249
250 virtual void checkNotify(); 250 virtual void checkNotify();
251 251
252 enum class MarkFinishedOption {
253 ShouldMarkFinished,
254 DoNotMarkFinished
255 };
256 void notifyClientsInternal(MarkFinishedOption);
257 void markClientFinished(ResourceClient*);
258
252 virtual void destroyDecodedDataForFailedRevalidation() { } 259 virtual void destroyDecodedDataForFailedRevalidation() { }
253 260
254 void setEncodedSize(size_t); 261 void setEncodedSize(size_t);
255 void setDecodedSize(size_t); 262 void setDecodedSize(size_t);
256 void didAccessDecodedData(); 263 void didAccessDecodedData();
257 264
258 void finishPendingClients(); 265 void finishPendingClients();
259 266
260 virtual void didAddClient(ResourceClient*); 267 virtual void didAddClient(ResourceClient*);
261 void willAddClientOrObserver(); 268 void willAddClientOrObserver();
(...skipping 14 matching lines...) Expand all
276 } 283 }
277 284
278 ResourceRequest m_request; 285 ResourceRequest m_request;
279 ResourceResponse m_redirectResponse; 286 ResourceResponse m_redirectResponse;
280 }; 287 };
281 const Vector<RedirectPair>& redirectChain() const { return m_redirectChain; } 288 const Vector<RedirectPair>& redirectChain() const { return m_redirectChain; }
282 289
283 virtual bool isSafeToUnlock() const { return false; } 290 virtual bool isSafeToUnlock() const { return false; }
284 virtual void destroyDecodedDataIfPossible() { } 291 virtual void destroyDecodedDataIfPossible() { }
285 292
286 virtual void markClientsAndObserversFinished();
287
288 // Returns the memory dump name used for tracing. See Resource::onMemoryDump . 293 // Returns the memory dump name used for tracing. See Resource::onMemoryDump .
289 String getMemoryDumpName() const; 294 String getMemoryDumpName() const;
290 295
291 const HashCountedSet<ResourceClient*>& clients() const { return m_clients; } 296 const HashCountedSet<ResourceClient*>& clients() const { return m_clients; }
292 DataBufferingPolicy dataBufferingPolicy() const { return m_options.dataBuffe ringPolicy; } 297 DataBufferingPolicy dataBufferingPolicy() const { return m_options.dataBuffe ringPolicy; }
293 298
294 void setCachePolicyBypassingCache(); 299 void setCachePolicyBypassingCache();
295 void setLoFiStateOff(); 300 void setLoFiStateOff();
296 301
297 SharedBuffer* data() const { return m_data.get(); } 302 SharedBuffer* data() const { return m_data.get(); }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 381
377 Resource::Type m_type; 382 Resource::Type m_type;
378 }; 383 };
379 384
380 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 385 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
381 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType( ) == Resource::typeName, resource.getType() == Resource::typeName); 386 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType( ) == Resource::typeName, resource.getType() == Resource::typeName);
382 387
383 } // namespace blink 388 } // namespace blink
384 389
385 #endif 390 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698