OLD | NEW |
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 Apple Inc. All rights reserved. | 6 Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 ImageResourceObserverWalker walker(m_observers); | 99 ImageResourceObserverWalker walker(m_observers); |
100 while (auto* observer = walker.next()) { | 100 while (auto* observer = walker.next()) { |
101 observer->imageNotifyFinished(this); | 101 observer->imageNotifyFinished(this); |
102 } | 102 } |
103 | 103 |
104 Resource::checkNotify(); | 104 Resource::checkNotify(); |
105 } | 105 } |
106 | 106 |
107 void ImageResource::markClientsAndObserversFinished() | 107 void ImageResource::markClientsAndObserversFinished() |
108 { | 108 { |
109 while (!m_observers.isEmpty()) { | 109 HashCountedSet<ImageResourceObserver*> observers; |
110 HashCountedSet<ImageResourceObserver*>::iterator it = m_observers.begin(
); | 110 m_observers.swap(observers); |
111 for (int i = it->value; i; i--) { | 111 for (const auto& it : observers) |
112 m_finishedObservers.add(it->key); | 112 m_finishedObservers.add(it.key, it.value); |
113 m_observers.remove(it); | |
114 } | |
115 } | |
116 | 113 |
117 Resource::markClientsAndObserversFinished(); | 114 Resource::markClientsAndObserversFinished(); |
118 } | 115 } |
119 | 116 |
120 void ImageResource::addObserver(ImageResourceObserver* observer) | 117 void ImageResource::addObserver(ImageResourceObserver* observer) |
121 { | 118 { |
122 willAddClientOrObserver(); | 119 willAddClientOrObserver(); |
123 | 120 |
124 m_observers.add(observer); | 121 m_observers.add(observer); |
125 | 122 |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 if (response().wasFetchedViaServiceWorker()) | 549 if (response().wasFetchedViaServiceWorker()) |
553 return response().serviceWorkerResponseType() != WebServiceWorkerRespons
eTypeOpaque; | 550 return response().serviceWorkerResponseType() != WebServiceWorkerRespons
eTypeOpaque; |
554 if (!getImage()->currentFrameHasSingleSecurityOrigin()) | 551 if (!getImage()->currentFrameHasSingleSecurityOrigin()) |
555 return false; | 552 return false; |
556 if (passesAccessControlCheck(securityOrigin)) | 553 if (passesAccessControlCheck(securityOrigin)) |
557 return true; | 554 return true; |
558 return !securityOrigin->taintsCanvas(response().url()); | 555 return !securityOrigin->taintsCanvas(response().url()); |
559 } | 556 } |
560 | 557 |
561 } // namespace blink | 558 } // namespace blink |
OLD | NEW |