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

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

Issue 2308393002: Mark ResourceClient/ImageResourceObserver finished just before notifying (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2785
Patch Set: 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 /* 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 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail, WebProcessMemoryDump*) const; 240 virtual void onMemoryDump(WebMemoryDumpLevelOfDetail, WebProcessMemoryDump*) const;
241 241
242 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&); 242 static const char* resourceTypeToString(Type, const FetchInitiatorInfo&);
243 static const char* resourceTypeName(Type); 243 static const char* resourceTypeName(Type);
244 244
245 protected: 245 protected:
246 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&); 246 Resource(const ResourceRequest&, Type, const ResourceLoaderOptions&);
247 247
248 virtual void checkNotify(); 248 virtual void checkNotify();
249 249
250 enum class MarkFinishedOption {
251 ShouldMarkFinished,
252 DoNotMarkFinished
253 };
254 void notifyClientsInternal(MarkFinishedOption);
255 void markClientFinished(ResourceClient*);
256
250 virtual void destroyDecodedDataForFailedRevalidation() { } 257 virtual void destroyDecodedDataForFailedRevalidation() { }
251 258
252 void setEncodedSize(size_t); 259 void setEncodedSize(size_t);
253 void setDecodedSize(size_t); 260 void setDecodedSize(size_t);
254 void didAccessDecodedData(); 261 void didAccessDecodedData();
255 262
256 void finishPendingClients(); 263 void finishPendingClients();
257 264
258 virtual void didAddClient(ResourceClient*); 265 virtual void didAddClient(ResourceClient*);
259 void willAddClientOrObserver(); 266 void willAddClientOrObserver();
(...skipping 18 matching lines...) Expand all
278 } 285 }
279 286
280 ResourceRequest m_request; 287 ResourceRequest m_request;
281 ResourceResponse m_redirectResponse; 288 ResourceResponse m_redirectResponse;
282 }; 289 };
283 const Vector<RedirectPair>& redirectChain() const { return m_redirectChain; } 290 const Vector<RedirectPair>& redirectChain() const { return m_redirectChain; }
284 291
285 virtual bool isSafeToUnlock() const { return false; } 292 virtual bool isSafeToUnlock() const { return false; }
286 virtual void destroyDecodedDataIfPossible() { } 293 virtual void destroyDecodedDataIfPossible() { }
287 294
288 virtual void markClientsAndObserversFinished();
289
290 // Returns the memory dump name used for tracing. See Resource::onMemoryDump . 295 // Returns the memory dump name used for tracing. See Resource::onMemoryDump .
291 String getMemoryDumpName() const; 296 String getMemoryDumpName() const;
292 297
293 ResourceRequest m_resourceRequest; 298 ResourceRequest m_resourceRequest;
294 Member<ResourceLoader> m_loader; 299 Member<ResourceLoader> m_loader;
295 ResourceLoaderOptions m_options; 300 ResourceLoaderOptions m_options;
296 301
297 ResourceResponse m_response; 302 ResourceResponse m_response;
298 double m_responseTimestamp; 303 double m_responseTimestamp;
299 304
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 366
362 Resource::Type m_type; 367 Resource::Type m_type;
363 }; 368 };
364 369
365 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \ 370 #define DEFINE_RESOURCE_TYPE_CASTS(typeName) \
366 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType( ) == Resource::typeName, resource.getType() == Resource::typeName); 371 DEFINE_TYPE_CASTS(typeName##Resource, Resource, resource, resource->getType( ) == Resource::typeName, resource.getType() == Resource::typeName);
367 372
368 } // namespace blink 373 } // namespace blink
369 374
370 #endif 375 #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