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" |
11 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 11 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
12 #include "third_party/WebKit/public/web/WebAssociatedURLLoaderOptions.h" | 12 #include "third_party/WebKit/public/web/WebAssociatedURLLoaderOptions.h" |
13 #include "third_party/WebKit/public/web/WebFrame.h" | 13 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
14 #include "third_party/skia/include/core/SkBitmap.h" | 14 #include "third_party/skia/include/core/SkBitmap.h" |
15 #include "ui/gfx/geometry/size.h" | 15 #include "ui/gfx/geometry/size.h" |
16 | 16 |
17 using blink::WebFrame; | 17 using blink::WebLocalFrame; |
18 using blink::WebAssociatedURLLoaderOptions; | 18 using blink::WebAssociatedURLLoaderOptions; |
19 using blink::WebURLRequest; | 19 using blink::WebURLRequest; |
20 using blink::WebURLResponse; | 20 using blink::WebURLResponse; |
21 | 21 |
22 namespace content { | 22 namespace content { |
23 | 23 |
24 MultiResolutionImageResourceFetcher::MultiResolutionImageResourceFetcher( | 24 MultiResolutionImageResourceFetcher::MultiResolutionImageResourceFetcher( |
25 const GURL& image_url, | 25 const GURL& image_url, |
26 WebFrame* frame, | 26 WebLocalFrame* frame, |
27 int id, | 27 int id, |
28 WebURLRequest::RequestContext request_context, | 28 WebURLRequest::RequestContext request_context, |
29 blink::WebCachePolicy cache_policy, | 29 blink::WebCachePolicy cache_policy, |
30 const Callback& callback) | 30 const Callback& callback) |
31 : callback_(callback), | 31 : callback_(callback), |
32 id_(id), | 32 id_(id), |
33 http_status_code_(0), | 33 http_status_code_(0), |
34 image_url_(image_url) { | 34 image_url_(image_url) { |
35 fetcher_.reset(AssociatedResourceFetcher::Create(image_url)); | 35 fetcher_.reset(AssociatedResourceFetcher::Create(image_url)); |
36 | 36 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 | 80 |
81 void MultiResolutionImageResourceFetcher::OnRenderFrameDestruct() { | 81 void MultiResolutionImageResourceFetcher::OnRenderFrameDestruct() { |
82 // Take a reference to the callback as running the callback may lead to our | 82 // Take a reference to the callback as running the callback may lead to our |
83 // destruction. | 83 // destruction. |
84 Callback callback = callback_; | 84 Callback callback = callback_; |
85 callback.Run(this, std::vector<SkBitmap>()); | 85 callback.Run(this, std::vector<SkBitmap>()); |
86 } | 86 } |
87 | 87 |
88 } // namespace content | 88 } // namespace content |
OLD | NEW |