Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: ios/chrome/browser/favicon/favicon_loader.h

Issue 1861593005: Convert //ios from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase? Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef IOS_CHROME_BROWSER_FAVICON_FAVICON_LOADER_H_ 5 #ifndef IOS_CHROME_BROWSER_FAVICON_FAVICON_LOADER_H_
6 #define IOS_CHROME_BROWSER_FAVICON_FAVICON_LOADER_H_ 6 #define IOS_CHROME_BROWSER_FAVICON_FAVICON_LOADER_H_
7 7
8 #include <memory>
8 #include <vector> 9 #include <vector>
9 10
10 #import "base/mac/scoped_nsobject.h" 11 #import "base/mac/scoped_nsobject.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "base/task/cancelable_task_tracker.h" 13 #include "base/task/cancelable_task_tracker.h"
14 #include "base/threading/thread_checker.h" 14 #include "base/threading/thread_checker.h"
15 #include "components/favicon_base/favicon_types.h" 15 #include "components/favicon_base/favicon_types.h"
16 #include "components/keyed_service/core/keyed_service.h" 16 #include "components/keyed_service/core/keyed_service.h"
17 17
18 class GURL; 18 class GURL;
19 @class NSMutableDictionary; 19 @class NSMutableDictionary;
20 @class UIImage; 20 @class UIImage;
21 21
22 namespace favicon { 22 namespace favicon {
(...skipping 23 matching lines...) Expand all
46 46
47 // Purges the cache, in response to low-memory. 47 // Purges the cache, in response to low-memory.
48 void PurgeCache(); 48 void PurgeCache();
49 49
50 private: 50 private:
51 struct RequestData; 51 struct RequestData;
52 52
53 // Called when the favicon load request completes. Saves image into the 53 // Called when the favicon load request completes. Saves image into the
54 // cache. Desktop code assumes this image is in PNG format. 54 // cache. Desktop code assumes this image is in PNG format.
55 void OnFaviconAvailable( 55 void OnFaviconAvailable(
56 scoped_ptr<RequestData> request_data, 56 std::unique_ptr<RequestData> request_data,
57 const std::vector<favicon_base::FaviconRawBitmapResult>& 57 const std::vector<favicon_base::FaviconRawBitmapResult>&
58 favicon_bitmap_results); 58 favicon_bitmap_results);
59 59
60 base::ThreadChecker thread_checker_; 60 base::ThreadChecker thread_checker_;
61 61
62 // The FaviconService used to retrieve favicon; may be null during testing. 62 // The FaviconService used to retrieve favicon; may be null during testing.
63 // Must outlive the FaviconLoader. 63 // Must outlive the FaviconLoader.
64 favicon::FaviconService* favicon_service_; 64 favicon::FaviconService* favicon_service_;
65 65
66 // Tracks tasks sent to FaviconService. 66 // Tracks tasks sent to FaviconService.
67 base::CancelableTaskTracker cancelable_task_tracker_; 67 base::CancelableTaskTracker cancelable_task_tracker_;
68 68
69 // Holds cached favicons. This dictionary is populated as favicons are 69 // Holds cached favicons. This dictionary is populated as favicons are
70 // retrieved from the FaviconService. This will be emptied during low-memory 70 // retrieved from the FaviconService. This will be emptied during low-memory
71 // conditions. Keyed by NSString of URL spec. 71 // conditions. Keyed by NSString of URL spec.
72 base::scoped_nsobject<NSMutableDictionary> favicon_cache_; 72 base::scoped_nsobject<NSMutableDictionary> favicon_cache_;
73 73
74 DISALLOW_COPY_AND_ASSIGN(FaviconLoader); 74 DISALLOW_COPY_AND_ASSIGN(FaviconLoader);
75 }; 75 };
76 76
77 #endif // IOS_CHROME_BROWSER_FAVICON_FAVICON_LOADER_H_ 77 #endif // IOS_CHROME_BROWSER_FAVICON_FAVICON_LOADER_H_
OLDNEW
« no previous file with comments | « ios/chrome/browser/dom_distiller/dom_distiller_service_factory.cc ('k') | ios/chrome/browser/favicon/favicon_loader.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698