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

Side by Side Diff: components/favicon/core/favicon_service.cc

Issue 1918083002: Convert //components/[f-n]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: … 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 (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 "components/favicon/core/favicon_service.h" 5 #include "components/favicon/core/favicon_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <cmath> 8 #include <cmath>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 std::vector<float> scales = favicon_base::GetFaviconScales(); 43 std::vector<float> scales = favicon_base::GetFaviconScales();
44 std::vector<int> sizes_in_pixel; 44 std::vector<int> sizes_in_pixel;
45 for (size_t i = 0; i < scales.size(); ++i) { 45 for (size_t i = 0; i < scales.size(); ++i) {
46 sizes_in_pixel.push_back(std::ceil(size_in_dip * scales[i])); 46 sizes_in_pixel.push_back(std::ceil(size_in_dip * scales[i]));
47 } 47 }
48 return sizes_in_pixel; 48 return sizes_in_pixel;
49 } 49 }
50 50
51 } // namespace 51 } // namespace
52 52
53 FaviconService::FaviconService(scoped_ptr<FaviconClient> favicon_client, 53 FaviconService::FaviconService(std::unique_ptr<FaviconClient> favicon_client,
54 history::HistoryService* history_service) 54 history::HistoryService* history_service)
55 : favicon_client_(std::move(favicon_client)), 55 : favicon_client_(std::move(favicon_client)),
56 history_service_(history_service) {} 56 history_service_(history_service) {}
57 57
58 FaviconService::~FaviconService() { 58 FaviconService::~FaviconService() {
59 } 59 }
60 60
61 // static 61 // static
62 void FaviconService::FaviconResultsCallbackRunner( 62 void FaviconService::FaviconResultsCallbackRunner(
63 const favicon_base::FaviconResultsCallback& callback, 63 const favicon_base::FaviconResultsCallback& callback,
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 callback.Run(favicon_base::FaviconRawBitmapResult()); 367 callback.Run(favicon_base::FaviconRawBitmapResult());
368 return; 368 return;
369 } 369 }
370 370
371 bitmap_result.bitmap_data = base::RefCountedBytes::TakeVector( 371 bitmap_result.bitmap_data = base::RefCountedBytes::TakeVector(
372 &resized_bitmap_data); 372 &resized_bitmap_data);
373 callback.Run(bitmap_result); 373 callback.Run(bitmap_result);
374 } 374 }
375 375
376 } // namespace favicon 376 } // namespace favicon
OLDNEW
« no previous file with comments | « components/favicon/core/favicon_service.h ('k') | components/favicon/core/large_icon_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698