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

Side by Side Diff: chrome/browser/history/chrome_history_backend_client.cc

Issue 2847013003: Switch SupportsUserData uses to use unique_ptr. (Closed)
Patch Set: rev Created 3 years, 7 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
« no previous file with comments | « no previous file | components/history/content/browser/web_contents_top_sites_observer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/history/chrome_history_backend_client.h" 5 #include "chrome/browser/history/chrome_history_backend_client.h"
6 6
7 #include "base/memory/ptr_util.h"
7 #include "build/build_config.h" 8 #include "build/build_config.h"
8 #include "chrome/common/channel_info.h" 9 #include "chrome/common/channel_info.h"
9 #include "components/bookmarks/browser/bookmark_model.h" 10 #include "components/bookmarks/browser/bookmark_model.h"
10 #include "components/version_info/version_info.h" 11 #include "components/version_info/version_info.h"
11 #include "content/public/browser/child_process_security_policy.h" 12 #include "content/public/browser/child_process_security_policy.h"
12 #include "url/gurl.h" 13 #include "url/gurl.h"
13 14
14 #if defined(OS_ANDROID) 15 #if defined(OS_ANDROID)
15 #include "base/files/file_path.h" 16 #include "base/files/file_path.h"
16 #include "base/logging.h" 17 #include "base/logging.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 #if defined(OS_ANDROID) 81 #if defined(OS_ANDROID)
81 void ChromeHistoryBackendClient::OnHistoryBackendInitialized( 82 void ChromeHistoryBackendClient::OnHistoryBackendInitialized(
82 history::HistoryBackend* history_backend, 83 history::HistoryBackend* history_backend,
83 history::HistoryDatabase* history_database, 84 history::HistoryDatabase* history_database,
84 history::ThumbnailDatabase* thumbnail_database, 85 history::ThumbnailDatabase* thumbnail_database,
85 const base::FilePath& history_dir) { 86 const base::FilePath& history_dir) {
86 DCHECK(history_backend); 87 DCHECK(history_backend);
87 if (thumbnail_database) { 88 if (thumbnail_database) {
88 history_backend->SetUserData( 89 history_backend->SetUserData(
89 history::AndroidProviderBackend::GetUserDataKey(), 90 history::AndroidProviderBackend::GetUserDataKey(),
90 new history::AndroidProviderBackend( 91 base::MakeUnique<history::AndroidProviderBackend>(
91 history_dir.Append(kAndroidCacheFilename), history_database, 92 history_dir.Append(kAndroidCacheFilename), history_database,
92 thumbnail_database, this, history_backend)); 93 thumbnail_database, this, history_backend));
93 } 94 }
94 } 95 }
95 96
96 void ChromeHistoryBackendClient::OnHistoryBackendDestroyed( 97 void ChromeHistoryBackendClient::OnHistoryBackendDestroyed(
97 history::HistoryBackend* history_backend, 98 history::HistoryBackend* history_backend,
98 const base::FilePath& history_dir) { 99 const base::FilePath& history_dir) {
99 sql::Connection::Delete(history_dir.Append(kAndroidCacheFilename)); 100 sql::Connection::Delete(history_dir.Append(kAndroidCacheFilename));
100 } 101 }
101 #endif // defined(OS_ANDROID) 102 #endif // defined(OS_ANDROID)
OLDNEW
« no previous file with comments | « no previous file | components/history/content/browser/web_contents_top_sites_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698