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

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

Issue 2513413008: [ImageResource 0a] Do not notify ResourceClient/ImageResourceObserver of finish twice (Closed)
Patch Set: Rebase Created 4 years 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 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
6 rights reserved. 6 rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail, 331 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail,
332 WebProcessMemoryDump*) const; 332 WebProcessMemoryDump*) const;
333 333
334 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&); 334 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&);
335 335
336 protected: 336 protected:
337 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&); 337 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&);
338 338
339 virtual void checkNotify(); 339 virtual void checkNotify();
340 340
341 enum class MarkFinishedOption { ShouldMarkFinished, DoNotMarkFinished }; 341 void notifyClientsInternal();
342 void notifyClientsInternal(MarkFinishedOption);
yhirano 2016/11/29 02:23:30 Is it a good idea to merge this function to checkN
hiroshige 2016/11/29 07:54:31 Done.
343 void markClientFinished(ResourceClient*); 342 void markClientFinished(ResourceClient*);
344 343
345 virtual bool hasClientsOrObservers() const { 344 virtual bool hasClientsOrObservers() const {
346 return !m_clients.isEmpty() || !m_clientsAwaitingCallback.isEmpty() || 345 return !m_clients.isEmpty() || !m_clientsAwaitingCallback.isEmpty() ||
347 !m_finishedClients.isEmpty(); 346 !m_finishedClients.isEmpty();
348 } 347 }
349 virtual void destroyDecodedDataForFailedRevalidation() {} 348 virtual void destroyDecodedDataForFailedRevalidation() {}
350 349
351 void setEncodedSize(size_t); 350 void setEncodedSize(size_t);
352 void setDecodedSize(size_t); 351 void setDecodedSize(size_t);
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 }; 493 };
495 494
496 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 495 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
497 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \ 496 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, \
498 resource->getType() == Resource::typeName, \ 497 resource->getType() == Resource::typeName, \
499 resource.getType() == Resource::typeName); 498 resource.getType() == Resource::typeName);
500 499
501 } // namespace blink 500 } // namespace blink
502 501
503 #endif 502 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.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