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

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2842833003: Update SupportsUserData uses with unique_ptr. (Closed)
Patch Set: rebase 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
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 "chrome/browser/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 1197 matching lines...) Expand 10 before | Expand all | Expand 10 after
1208 #if BUILDFLAG(USE_BROWSER_SPELLCHECKER) 1208 #if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
1209 host->AddFilter(new SpellCheckMessageFilterPlatform(id)); 1209 host->AddFilter(new SpellCheckMessageFilterPlatform(id));
1210 #endif 1210 #endif
1211 host->AddFilter(new prerender::PrerenderMessageFilter(id, profile)); 1211 host->AddFilter(new prerender::PrerenderMessageFilter(id, profile));
1212 host->AddFilter(new TtsMessageFilter(host->GetBrowserContext())); 1212 host->AddFilter(new TtsMessageFilter(host->GetBrowserContext()));
1213 #if BUILDFLAG(ENABLE_WEBRTC) 1213 #if BUILDFLAG(ENABLE_WEBRTC)
1214 WebRtcLoggingHandlerHost* webrtc_logging_handler_host = 1214 WebRtcLoggingHandlerHost* webrtc_logging_handler_host =
1215 new WebRtcLoggingHandlerHost(id, profile, 1215 new WebRtcLoggingHandlerHost(id, profile,
1216 g_browser_process->webrtc_log_uploader()); 1216 g_browser_process->webrtc_log_uploader());
1217 host->AddFilter(webrtc_logging_handler_host); 1217 host->AddFilter(webrtc_logging_handler_host);
1218 host->SetUserData(WebRtcLoggingHandlerHost::kWebRtcLoggingHandlerHostKey, 1218 host->SetUserData(
1219 new base::UserDataAdapter<WebRtcLoggingHandlerHost>( 1219 WebRtcLoggingHandlerHost::kWebRtcLoggingHandlerHostKey,
1220 webrtc_logging_handler_host)); 1220 base::MakeUnique<base::UserDataAdapter<WebRtcLoggingHandlerHost>>(
1221 webrtc_logging_handler_host));
1221 1222
1222 // The audio manager outlives the host, so it's safe to hand a raw pointer to 1223 // The audio manager outlives the host, so it's safe to hand a raw pointer to
1223 // it to the AudioDebugRecordingsHandler, which is owned by the host. 1224 // it to the AudioDebugRecordingsHandler, which is owned by the host.
1224 AudioDebugRecordingsHandler* audio_debug_recordings_handler = 1225 AudioDebugRecordingsHandler* audio_debug_recordings_handler =
1225 new AudioDebugRecordingsHandler(profile, media::AudioManager::Get()); 1226 new AudioDebugRecordingsHandler(profile, media::AudioManager::Get());
1226 host->SetUserData( 1227 host->SetUserData(
1227 AudioDebugRecordingsHandler::kAudioDebugRecordingsHandlerKey, 1228 AudioDebugRecordingsHandler::kAudioDebugRecordingsHandlerKey,
1228 new base::UserDataAdapter<AudioDebugRecordingsHandler>( 1229 base::MakeUnique<base::UserDataAdapter<AudioDebugRecordingsHandler>>(
1229 audio_debug_recordings_handler)); 1230 audio_debug_recordings_handler));
1230 1231
1231 #endif 1232 #endif
1232 #if !defined(DISABLE_NACL) 1233 #if !defined(DISABLE_NACL)
1233 net::URLRequestContextGetter* context = 1234 net::URLRequestContextGetter* context =
1234 host->GetStoragePartition()->GetURLRequestContext(); 1235 host->GetStoragePartition()->GetURLRequestContext();
1235 host->AddFilter(new nacl::NaClHostMessageFilter( 1236 host->AddFilter(new nacl::NaClHostMessageFilter(
1236 id, profile->IsOffTheRecord(), 1237 id, profile->IsOffTheRecord(),
1237 profile->GetPath(), 1238 profile->GetPath(),
1238 context)); 1239 context));
(...skipping 2385 matching lines...) Expand 10 before | Expand all | Expand 10 after
3624 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { 3625 RedirectNonUINonIOBrowserThreadsToTaskScheduler() {
3625 return variations::GetVariationParamValue( 3626 return variations::GetVariationParamValue(
3626 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; 3627 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true";
3627 } 3628 }
3628 3629
3629 // static 3630 // static
3630 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( 3631 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting(
3631 const storage::QuotaSettings* settings) { 3632 const storage::QuotaSettings* settings) {
3632 g_default_quota_settings = settings; 3633 g_default_quota_settings = settings;
3633 } 3634 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698