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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 void ImageResource::markClientsAndObserversFinished() | 108 void ImageResource::markClientsAndObserversFinished() |
109 { | 109 { |
110 HashCountedSet<ImageResourceObserver*> observers; | 110 HashCountedSet<ImageResourceObserver*> observers; |
111 m_observers.swap(observers); | 111 m_observers.swap(observers); |
112 for (const auto& it : observers) | 112 for (const auto& it : observers) |
113 m_finishedObservers.add(it.key, it.value); | 113 m_finishedObservers.add(it.key, it.value); |
114 | 114 |
115 Resource::markClientsAndObserversFinished(); | 115 Resource::markClientsAndObserversFinished(); |
116 } | 116 } |
117 | 117 |
118 void ImageResource::didAddClient(ResourceClient* client) | |
119 { | |
120 if (m_data && !m_image && !errorOccurred()) { | |
121 createImage(); | |
122 m_image->setData(m_data, true); | |
hajimehoshi
2016/07/12 08:38:26
There is same code in addObserver. How about creat
hiroshige
2016/07/12 08:58:21
Done.
| |
123 } | |
124 | |
125 Resource::didAddClient(client); | |
126 } | |
127 | |
118 void ImageResource::addObserver(ImageResourceObserver* observer) | 128 void ImageResource::addObserver(ImageResourceObserver* observer) |
119 { | 129 { |
120 willAddClientOrObserver(); | 130 willAddClientOrObserver(); |
121 | 131 |
122 m_observers.add(observer); | 132 m_observers.add(observer); |
123 | 133 |
124 if (isCacheValidator()) | 134 if (isCacheValidator()) |
125 return; | 135 return; |
126 | 136 |
127 if (m_data && !m_image && !errorOccurred()) { | 137 if (m_data && !m_image && !errorOccurred()) { |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
564 if (response().wasFetchedViaServiceWorker()) | 574 if (response().wasFetchedViaServiceWorker()) |
565 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque; | 575 return response().serviceWorkerResponseType() != WebServiceWorkerRespons eTypeOpaque; |
566 if (!getImage()->currentFrameHasSingleSecurityOrigin()) | 576 if (!getImage()->currentFrameHasSingleSecurityOrigin()) |
567 return false; | 577 return false; |
568 if (passesAccessControlCheck(securityOrigin)) | 578 if (passesAccessControlCheck(securityOrigin)) |
569 return true; | 579 return true; |
570 return !securityOrigin->taintsCanvas(response().url()); | 580 return !securityOrigin->taintsCanvas(response().url()); |
571 } | 581 } |
572 | 582 |
573 } // namespace blink | 583 } // namespace blink |
OLD | NEW |