OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/image_resource_fetcher.h" | 5 #include "content/renderer/fetchers/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 "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
10 #include "content/child/image_decoder.h" | 10 #include "content/child/image_decoder.h" |
11 #include "third_party/WebKit/public/web/WebFrame.h" | 11 #include "third_party/WebKit/public/web/WebFrame.h" |
12 #include "third_party/skia/include/core/SkBitmap.h" | 12 #include "third_party/skia/include/core/SkBitmap.h" |
13 #include "ui/gfx/size.h" | 13 #include "ui/gfx/size.h" |
14 | 14 |
15 using WebKit::WebFrame; | 15 using blink::WebFrame; |
16 using WebKit::WebURLRequest; | 16 using blink::WebURLRequest; |
17 using WebKit::WebURLResponse; | 17 using blink::WebURLResponse; |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 | 20 |
21 ImageResourceFetcher::ImageResourceFetcher( | 21 ImageResourceFetcher::ImageResourceFetcher( |
22 const GURL& image_url, | 22 const GURL& image_url, |
23 WebFrame* frame, | 23 WebFrame* frame, |
24 int id, | 24 int id, |
25 int image_size, | 25 int image_size, |
26 WebURLRequest::TargetType target_type, | 26 WebURLRequest::TargetType target_type, |
27 const Callback& callback) | 27 const Callback& callback) |
(...skipping 29 matching lines...) Expand all Loading... |
57 // response as an image. The delegate will see a null image, indicating | 57 // response as an image. The delegate will see a null image, indicating |
58 // that an error occurred. | 58 // that an error occurred. |
59 | 59 |
60 // Take a reference to the callback as running the callback may lead to our | 60 // Take a reference to the callback as running the callback may lead to our |
61 // destruction. | 61 // destruction. |
62 Callback callback = callback_; | 62 Callback callback = callback_; |
63 callback.Run(this, bitmap); | 63 callback.Run(this, bitmap); |
64 } | 64 } |
65 | 65 |
66 } // namespace content | 66 } // namespace content |
OLD | NEW |