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

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

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) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All
7 rights reserved. 7 rights reserved.
8 8
9 This library is free software; you can redistribute it and/or 9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public 10 modify it under the terms of the GNU Library General Public
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 } 348 }
349 349
350 void Resource::setLoader(ResourceLoader* loader) { 350 void Resource::setLoader(ResourceLoader* loader) {
351 CHECK(!m_loader); 351 CHECK(!m_loader);
352 DCHECK(stillNeedsLoad()); 352 DCHECK(stillNeedsLoad());
353 m_loader = loader; 353 m_loader = loader;
354 m_status = Pending; 354 m_status = Pending;
355 } 355 }
356 356
357 void Resource::checkNotify() { 357 void Resource::checkNotify() {
358 notifyClientsInternal(MarkFinishedOption::ShouldMarkFinished); 358 notifyClientsInternal();
359 } 359 }
360 360
361 void Resource::notifyClientsInternal(MarkFinishedOption markFinishedOption) { 361 void Resource::notifyClientsInternal() {
362 if (isLoading()) 362 if (isLoading())
363 return; 363 return;
364 364
365 ResourceClientWalker<ResourceClient> w(m_clients); 365 ResourceClientWalker<ResourceClient> w(m_clients);
366 while (ResourceClient* c = w.next()) { 366 while (ResourceClient* c = w.next()) {
367 if (markFinishedOption == MarkFinishedOption::ShouldMarkFinished) 367 markClientFinished(c);
368 markClientFinished(c);
369 c->notifyFinished(this); 368 c->notifyFinished(this);
370 } 369 }
371 } 370 }
372 371
373 void Resource::markClientFinished(ResourceClient* client) { 372 void Resource::markClientFinished(ResourceClient* client) {
374 if (m_clients.contains(client)) { 373 if (m_clients.contains(client)) {
375 m_finishedClients.add(client); 374 m_finishedClients.add(client);
376 m_clients.remove(client); 375 m_clients.remove(client);
377 } 376 }
378 } 377 }
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
1104 case Resource::TextTrack: 1103 case Resource::TextTrack:
1105 case Resource::Media: 1104 case Resource::Media:
1106 case Resource::Manifest: 1105 case Resource::Manifest:
1107 return false; 1106 return false;
1108 } 1107 }
1109 NOTREACHED(); 1108 NOTREACHED();
1110 return false; 1109 return false;
1111 } 1110 }
1112 1111
1113 } // namespace blink 1112 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698