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 "chrome/browser/favicon/favicon_service.h" | 5 #include "chrome/browser/favicon/favicon_service.h" |
6 | 6 |
7 #include "base/hash.h" | 7 #include "base/hash.h" |
8 #include "base/message_loop/message_loop_proxy.h" | 8 #include "base/message_loop/message_loop_proxy.h" |
9 #include "chrome/browser/favicon/favicon_types.h" | 9 #include "chrome/browser/favicon/favicon_types.h" |
10 #include "chrome/browser/favicon/favicon_util.h" | 10 #include "chrome/browser/favicon/favicon_util.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 return; | 33 return; |
34 callback.Run(results); | 34 callback.Run(results); |
35 } | 35 } |
36 | 36 |
37 // Helper to run callback with empty results if we cannot get the history | 37 // Helper to run callback with empty results if we cannot get the history |
38 // service. | 38 // service. |
39 CancelableTaskTracker::TaskId RunWithEmptyResultAsync( | 39 CancelableTaskTracker::TaskId RunWithEmptyResultAsync( |
40 const FaviconService::FaviconResultsCallback& callback, | 40 const FaviconService::FaviconResultsCallback& callback, |
41 CancelableTaskTracker* tracker) { | 41 CancelableTaskTracker* tracker) { |
42 return tracker->PostTask( | 42 return tracker->PostTask( |
43 base::MessageLoopProxy::current(), | 43 base::MessageLoopProxy::current().get(), |
44 FROM_HERE, | 44 FROM_HERE, |
45 Bind(callback, std::vector<chrome::FaviconBitmapResult>())); | 45 Bind(callback, std::vector<chrome::FaviconBitmapResult>())); |
46 } | 46 } |
47 | 47 |
48 } // namespace | 48 } // namespace |
49 | 49 |
50 FaviconService::FaviconService(HistoryService* history_service) | 50 FaviconService::FaviconService(HistoryService* history_service) |
51 : history_service_(history_service) { | 51 : history_service_(history_service) { |
52 } | 52 } |
53 | 53 |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 &resized_bitmap_data)) { | 363 &resized_bitmap_data)) { |
364 callback.Run(chrome::FaviconBitmapResult()); | 364 callback.Run(chrome::FaviconBitmapResult()); |
365 return; | 365 return; |
366 } | 366 } |
367 | 367 |
368 bitmap_result.bitmap_data = base::RefCountedBytes::TakeVector( | 368 bitmap_result.bitmap_data = base::RefCountedBytes::TakeVector( |
369 &resized_bitmap_data); | 369 &resized_bitmap_data); |
370 callback.Run(bitmap_result); | 370 callback.Run(bitmap_result); |
371 } | 371 } |
372 | 372 |
OLD | NEW |