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

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

Issue 2618393003: Remove ScopedVector from ContentBrowserClient. (Closed)
Patch Set: chromeos Created 3 years, 11 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 2766 matching lines...) Expand 10 before | Expand all | Expand 10 after
2777 extra_parts_[i]->GetURLRequestAutoMountHandlers(handlers); 2777 extra_parts_[i]->GetURLRequestAutoMountHandlers(handlers);
2778 } 2778 }
2779 2779
2780 ::rappor::RapporService* ChromeContentBrowserClient::GetRapporService() { 2780 ::rappor::RapporService* ChromeContentBrowserClient::GetRapporService() {
2781 return g_browser_process->rappor_service(); 2781 return g_browser_process->rappor_service();
2782 } 2782 }
2783 2783
2784 void ChromeContentBrowserClient::GetAdditionalFileSystemBackends( 2784 void ChromeContentBrowserClient::GetAdditionalFileSystemBackends(
2785 content::BrowserContext* browser_context, 2785 content::BrowserContext* browser_context,
2786 const base::FilePath& storage_partition_path, 2786 const base::FilePath& storage_partition_path,
2787 ScopedVector<storage::FileSystemBackend>* additional_backends) { 2787 std::vector<std::unique_ptr<storage::FileSystemBackend>>*
2788 additional_backends) {
2788 #if defined(OS_CHROMEOS) 2789 #if defined(OS_CHROMEOS)
2789 storage::ExternalMountPoints* external_mount_points = 2790 storage::ExternalMountPoints* external_mount_points =
2790 content::BrowserContext::GetMountPoints(browser_context); 2791 content::BrowserContext::GetMountPoints(browser_context);
2791 DCHECK(external_mount_points); 2792 DCHECK(external_mount_points);
2792 chromeos::FileSystemBackend* backend = new chromeos::FileSystemBackend( 2793 auto backend = base::MakeUnique<chromeos::FileSystemBackend>(
2793 base::MakeUnique<drive::FileSystemBackendDelegate>(), 2794 base::MakeUnique<drive::FileSystemBackendDelegate>(),
2794 base::MakeUnique<chromeos::file_system_provider::BackendDelegate>(), 2795 base::MakeUnique<chromeos::file_system_provider::BackendDelegate>(),
2795 base::MakeUnique<chromeos::MTPFileSystemBackendDelegate>( 2796 base::MakeUnique<chromeos::MTPFileSystemBackendDelegate>(
2796 storage_partition_path), 2797 storage_partition_path),
2797 base::MakeUnique<arc::ArcContentFileSystemBackendDelegate>(), 2798 base::MakeUnique<arc::ArcContentFileSystemBackendDelegate>(),
2798 base::MakeUnique<arc::ArcDocumentsProviderBackendDelegate>(), 2799 base::MakeUnique<arc::ArcDocumentsProviderBackendDelegate>(),
2799 external_mount_points, storage::ExternalMountPoints::GetSystemInstance()); 2800 external_mount_points, storage::ExternalMountPoints::GetSystemInstance());
2800 backend->AddSystemMountPoints(); 2801 backend->AddSystemMountPoints();
2801 DCHECK(backend->CanHandleType(storage::kFileSystemTypeExternal)); 2802 DCHECK(backend->CanHandleType(storage::kFileSystemTypeExternal));
2802 additional_backends->push_back(backend); 2803 additional_backends->push_back(std::move(backend));
2803 #endif 2804 #endif
2804 2805
2805 for (size_t i = 0; i < extra_parts_.size(); ++i) { 2806 for (size_t i = 0; i < extra_parts_.size(); ++i) {
2806 extra_parts_[i]->GetAdditionalFileSystemBackends( 2807 extra_parts_[i]->GetAdditionalFileSystemBackends(
2807 browser_context, storage_partition_path, additional_backends); 2808 browser_context, storage_partition_path, additional_backends);
2808 } 2809 }
2809 } 2810 }
2810 2811
2811 #if defined(OS_POSIX) && !defined(OS_MACOSX) 2812 #if defined(OS_POSIX) && !defined(OS_MACOSX)
2812 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( 2813 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
3159 } 3160 }
3160 3161
3161 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, 3162 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric,
3162 const GURL& url) { 3163 const GURL& url) {
3163 if (url.is_valid()) { 3164 if (url.is_valid()) {
3164 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), 3165 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(),
3165 metric, url); 3166 metric, url);
3166 } 3167 }
3167 } 3168 }
3168 3169
3169 ScopedVector<content::NavigationThrottle> 3170 std::vector<std::unique_ptr<content::NavigationThrottle>>
3170 ChromeContentBrowserClient::CreateThrottlesForNavigation( 3171 ChromeContentBrowserClient::CreateThrottlesForNavigation(
3171 content::NavigationHandle* handle) { 3172 content::NavigationHandle* handle) {
3172 ScopedVector<content::NavigationThrottle> throttles; 3173 std::vector<std::unique_ptr<content::NavigationThrottle>> throttles;
3173 3174
3174 #if BUILDFLAG(ENABLE_PLUGINS) 3175 #if BUILDFLAG(ENABLE_PLUGINS)
3175 std::unique_ptr<content::NavigationThrottle> flash_url_throttle = 3176 std::unique_ptr<content::NavigationThrottle> flash_url_throttle =
3176 FlashDownloadInterception::MaybeCreateThrottleFor(handle); 3177 FlashDownloadInterception::MaybeCreateThrottleFor(handle);
3177 if (flash_url_throttle) 3178 if (flash_url_throttle)
3178 throttles.push_back(std::move(flash_url_throttle)); 3179 throttles.push_back(std::move(flash_url_throttle));
3179 #endif 3180 #endif
3180 3181
3181 if (handle->IsInMainFrame()) { 3182 if (handle->IsInMainFrame()) {
3182 throttles.push_back( 3183 throttles.push_back(
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
3228 auto intent_picker_cb = base::Bind(ShowIntentPickerBubble()); 3229 auto intent_picker_cb = base::Bind(ShowIntentPickerBubble());
3229 auto url_to_arc_throttle = base::MakeUnique<arc::ArcNavigationThrottle>( 3230 auto url_to_arc_throttle = base::MakeUnique<arc::ArcNavigationThrottle>(
3230 handle, intent_picker_cb); 3231 handle, intent_picker_cb);
3231 throttles.push_back(std::move(url_to_arc_throttle)); 3232 throttles.push_back(std::move(url_to_arc_throttle));
3232 } 3233 }
3233 } 3234 }
3234 } 3235 }
3235 #endif 3236 #endif
3236 3237
3237 #if BUILDFLAG(ENABLE_EXTENSIONS) 3238 #if BUILDFLAG(ENABLE_EXTENSIONS)
3238 throttles.push_back(new extensions::ExtensionNavigationThrottle(handle)); 3239 throttles.push_back(
3240 base::MakeUnique<extensions::ExtensionNavigationThrottle>(handle));
3239 #endif 3241 #endif
3240 3242
3241 return throttles; 3243 return throttles;
3242 } 3244 }
3243 3245
3244 std::unique_ptr<content::NavigationUIData> 3246 std::unique_ptr<content::NavigationUIData>
3245 ChromeContentBrowserClient::GetNavigationUIData( 3247 ChromeContentBrowserClient::GetNavigationUIData(
3246 content::NavigationHandle* navigation_handle) { 3248 content::NavigationHandle* navigation_handle) {
3247 return base::MakeUnique<ChromeNavigationUIData>(navigation_handle); 3249 return base::MakeUnique<ChromeNavigationUIData>(navigation_handle);
3248 } 3250 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
3371 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() { 3373 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() {
3372 return variations::GetVariationParamValue( 3374 return variations::GetVariationParamValue(
3373 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true"; 3375 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true";
3374 } 3376 }
3375 3377
3376 bool ChromeContentBrowserClient:: 3378 bool ChromeContentBrowserClient::
3377 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { 3379 RedirectNonUINonIOBrowserThreadsToTaskScheduler() {
3378 return variations::GetVariationParamValue( 3380 return variations::GetVariationParamValue(
3379 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; 3381 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true";
3380 } 3382 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698