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

Side by Side Diff: components/search_provider_logos/logo_cache.cc

Issue 2257793002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/search_provider_logos/logo_cache.h" 5 #include "components/search_provider_logos/logo_cache.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 LogoCache::~LogoCache() { 64 LogoCache::~LogoCache() {
65 DCHECK(thread_checker_.CalledOnValidThread()); 65 DCHECK(thread_checker_.CalledOnValidThread());
66 } 66 }
67 67
68 void LogoCache::UpdateCachedLogoMetadata(const LogoMetadata& metadata) { 68 void LogoCache::UpdateCachedLogoMetadata(const LogoMetadata& metadata) {
69 DCHECK(thread_checker_.CalledOnValidThread()); 69 DCHECK(thread_checker_.CalledOnValidThread());
70 DCHECK(metadata_); 70 DCHECK(metadata_);
71 DCHECK_EQ(metadata_->fingerprint, metadata.fingerprint); 71 DCHECK_EQ(metadata_->fingerprint, metadata.fingerprint);
72 72
73 UpdateMetadata(base::WrapUnique(new LogoMetadata(metadata))); 73 UpdateMetadata(base::MakeUnique<LogoMetadata>(metadata));
74 WriteMetadata(); 74 WriteMetadata();
75 } 75 }
76 76
77 const LogoMetadata* LogoCache::GetCachedLogoMetadata() { 77 const LogoMetadata* LogoCache::GetCachedLogoMetadata() {
78 DCHECK(thread_checker_.CalledOnValidThread()); 78 DCHECK(thread_checker_.CalledOnValidThread());
79 ReadMetadataIfNeeded(); 79 ReadMetadataIfNeeded();
80 return metadata_.get(); 80 return metadata_.get();
81 } 81 }
82 82
83 void LogoCache::SetCachedLogo(const EncodedLogo* logo) { 83 void LogoCache::SetCachedLogo(const EncodedLogo* logo) {
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 base::DeleteFile(GetMetadataPath(), false); 236 base::DeleteFile(GetMetadataPath(), false);
237 } 237 }
238 238
239 bool LogoCache::EnsureCacheDirectoryExists() { 239 bool LogoCache::EnsureCacheDirectoryExists() {
240 if (base::DirectoryExists(cache_directory_)) 240 if (base::DirectoryExists(cache_directory_))
241 return true; 241 return true;
242 return base::CreateDirectory(cache_directory_); 242 return base::CreateDirectory(cache_directory_);
243 } 243 }
244 244
245 } // namespace search_provider_logos 245 } // namespace search_provider_logos
OLDNEW
« no previous file with comments | « components/search_engines/template_url_service_util_unittest.cc ('k') | components/signin/core/browser/test_signin_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698