| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/fetchers/multi_resolution_image_resource_fetcher.h" | 5 #include "content/renderer/fetchers/multi_resolution_image_resource_fetcher.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "content/child/image_decoder.h" | 9 #include "content/child/image_decoder.h" |
| 10 #include "content/public/renderer/associated_resource_fetcher.h" | 10 #include "content/public/renderer/associated_resource_fetcher.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 } // else case: | 74 } // else case: |
| 75 // If we get here, it means no image from server or couldn't decode the | 75 // If we get here, it means no image from server or couldn't decode the |
| 76 // response as an image. The delegate will see an empty vector. | 76 // response as an image. The delegate will see an empty vector. |
| 77 | 77 |
| 78 // Take a reference to the callback as running the callback may lead to our | 78 // Take a reference to the callback as running the callback may lead to our |
| 79 // destruction. | 79 // destruction. |
| 80 Callback callback = callback_; | 80 Callback callback = callback_; |
| 81 callback.Run(this, bitmaps); | 81 callback.Run(this, bitmaps); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void MultiResolutionImageResourceFetcher::OnRenderFrameDestruct() { |
| 85 // Take a reference to the callback as running the callback may lead to our |
| 86 // destruction. |
| 87 Callback callback = callback_; |
| 88 callback.Run(this, std::vector<SkBitmap>()); |
| 89 } |
| 90 |
| 84 } // namespace content | 91 } // namespace content |
| OLD | NEW |