OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/fetch/ImageResourceContent.h" | 5 #include "core/loader/resource/ImageResourceContent.h" |
6 | 6 |
7 #include "core/fetch/ImageResource.h" | 7 #include "core/loader/resource/ImageResource.h" |
8 #include "core/fetch/ImageResourceInfo.h" | 8 #include "core/loader/resource/ImageResourceInfo.h" |
9 #include "core/fetch/ImageResourceObserver.h" | 9 #include "core/loader/resource/ImageResourceObserver.h" |
10 #include "core/svg/graphics/SVGImage.h" | 10 #include "core/svg/graphics/SVGImage.h" |
11 #include "platform/Histogram.h" | 11 #include "platform/Histogram.h" |
12 #include "platform/RuntimeEnabledFeatures.h" | 12 #include "platform/RuntimeEnabledFeatures.h" |
13 #include "platform/SharedBuffer.h" | 13 #include "platform/SharedBuffer.h" |
14 #include "platform/geometry/IntSize.h" | 14 #include "platform/geometry/IntSize.h" |
15 #include "platform/graphics/BitmapImage.h" | 15 #include "platform/graphics/BitmapImage.h" |
16 #include "platform/graphics/PlaceholderImage.h" | 16 #include "platform/graphics/PlaceholderImage.h" |
17 #include "platform/tracing/TraceEvent.h" | 17 #include "platform/tracing/TraceEvent.h" |
18 #include "wtf/StdLibExtras.h" | 18 #include "wtf/StdLibExtras.h" |
19 #include "wtf/Vector.h" | 19 #include "wtf/Vector.h" |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 if (!image || image != m_image) | 360 if (!image || image != m_image) |
361 return; | 361 return; |
362 | 362 |
363 m_info->setDecodedSize(newSize); | 363 m_info->setDecodedSize(newSize); |
364 } | 364 } |
365 | 365 |
366 bool ImageResourceContent::shouldPauseAnimation(const blink::Image* image) { | 366 bool ImageResourceContent::shouldPauseAnimation(const blink::Image* image) { |
367 if (!image || image != m_image) | 367 if (!image || image != m_image) |
368 return false; | 368 return false; |
369 | 369 |
370 for (const auto& it : m_finishedObservers) | 370 for (const auto& it : m_finishedObservers) { |
371 if (it.key->willRenderImage()) | 371 if (it.key->willRenderImage()) |
372 return false; | 372 return false; |
| 373 } |
373 | 374 |
374 for (const auto& it : m_observers) | 375 for (const auto& it : m_observers) { |
375 if (it.key->willRenderImage()) | 376 if (it.key->willRenderImage()) |
376 return false; | 377 return false; |
| 378 } |
377 | 379 |
378 return true; | 380 return true; |
379 } | 381 } |
380 | 382 |
381 void ImageResourceContent::animationAdvanced(const blink::Image* image) { | 383 void ImageResourceContent::animationAdvanced(const blink::Image* image) { |
382 if (!image || image != m_image) | 384 if (!image || image != m_image) |
383 return; | 385 return; |
384 notifyObservers(DoNotNotifyFinish); | 386 notifyObservers(DoNotNotifyFinish); |
385 } | 387 } |
386 | 388 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 | 468 |
467 const ResourceResponse& ImageResourceContent::response() const { | 469 const ResourceResponse& ImageResourceContent::response() const { |
468 return m_info->response(); | 470 return m_info->response(); |
469 } | 471 } |
470 | 472 |
471 const ResourceError& ImageResourceContent::resourceError() const { | 473 const ResourceError& ImageResourceContent::resourceError() const { |
472 return m_info->resourceError(); | 474 return m_info->resourceError(); |
473 } | 475 } |
474 | 476 |
475 } // namespace blink | 477 } // namespace blink |
OLD | NEW |