| OLD | NEW |
| 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 21 matching lines...) Expand all Loading... |
| 32 #include "chrome/browser/after_startup_task_utils.h" | 32 #include "chrome/browser/after_startup_task_utils.h" |
| 33 #include "chrome/browser/apps/app_url_redirector.h" | 33 #include "chrome/browser/apps/app_url_redirector.h" |
| 34 #include "chrome/browser/browser_about_handler.h" | 34 #include "chrome/browser/browser_about_handler.h" |
| 35 #include "chrome/browser/browser_process.h" | 35 #include "chrome/browser/browser_process.h" |
| 36 #include "chrome/browser/browser_shutdown.h" | 36 #include "chrome/browser/browser_shutdown.h" |
| 37 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 37 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 38 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 38 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| 39 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" | 39 #include "chrome/browser/browsing_data/browsing_data_remover_factory.h" |
| 40 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h" | 40 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h" |
| 41 #include "chrome/browser/budget_service/budget_service_impl.h" | 41 #include "chrome/browser/budget_service/budget_service_impl.h" |
| 42 #include "chrome/browser/cache_stats_recorder.h" |
| 42 #include "chrome/browser/chrome_content_browser_client_parts.h" | 43 #include "chrome/browser/chrome_content_browser_client_parts.h" |
| 43 #include "chrome/browser/chrome_quota_permission_context.h" | 44 #include "chrome/browser/chrome_quota_permission_context.h" |
| 44 #include "chrome/browser/content_settings/cookie_settings_factory.h" | 45 #include "chrome/browser/content_settings/cookie_settings_factory.h" |
| 45 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 46 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 46 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 47 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 47 #include "chrome/browser/defaults.h" | 48 #include "chrome/browser/defaults.h" |
| 48 #include "chrome/browser/download/download_prefs.h" | 49 #include "chrome/browser/download/download_prefs.h" |
| 49 #include "chrome/browser/font_family_cache.h" | 50 #include "chrome/browser/font_family_cache.h" |
| 50 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" | 51 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" |
| 51 #include "chrome/browser/memory/chrome_memory_coordinator_delegate.h" | 52 #include "chrome/browser/memory/chrome_memory_coordinator_delegate.h" |
| (...skipping 3047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3099 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, | 3100 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, |
| 3100 L"\\\\.\\pipe\\chrome.nacl.*"); | 3101 L"\\\\.\\pipe\\chrome.nacl.*"); |
| 3101 if (result != sandbox::SBOX_ALL_OK) | 3102 if (result != sandbox::SBOX_ALL_OK) |
| 3102 return false; | 3103 return false; |
| 3103 return result == sandbox::SBOX_ALL_OK; | 3104 return result == sandbox::SBOX_ALL_OK; |
| 3104 } | 3105 } |
| 3105 #endif // defined(OS_WIN) | 3106 #endif // defined(OS_WIN) |
| 3106 | 3107 |
| 3107 void ChromeContentBrowserClient::ExposeInterfacesToRenderer( | 3108 void ChromeContentBrowserClient::ExposeInterfacesToRenderer( |
| 3108 service_manager::BinderRegistry* registry, | 3109 service_manager::BinderRegistry* registry, |
| 3110 content::AssociatedInterfaceRegistry* associated_registry, |
| 3109 content::RenderProcessHost* render_process_host) { | 3111 content::RenderProcessHost* render_process_host) { |
| 3112 // The CacheStatsRecorder is an associated binding, instead of a |
| 3113 // non-associated one, because the sender (in the renderer process) posts the |
| 3114 // message after a time delay, in order to rate limit. The association |
| 3115 // protects against the render process host ID being recycled in that time |
| 3116 // gap between the preparation and the execution of that IPC. |
| 3117 associated_registry->AddInterface( |
| 3118 base::Bind(&CacheStatsRecorder::Create, render_process_host->GetID())); |
| 3119 |
| 3110 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner = | 3120 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner = |
| 3111 content::BrowserThread::GetTaskRunnerForThread( | 3121 content::BrowserThread::GetTaskRunnerForThread( |
| 3112 content::BrowserThread::UI); | 3122 content::BrowserThread::UI); |
| 3113 registry->AddInterface( | 3123 registry->AddInterface( |
| 3114 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create), | 3124 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create), |
| 3115 ui_task_runner); | 3125 ui_task_runner); |
| 3116 registry->AddInterface( | 3126 registry->AddInterface( |
| 3117 base::Bind(&BudgetServiceImpl::Create, render_process_host->GetID()), | 3127 base::Bind(&BudgetServiceImpl::Create, render_process_host->GetID()), |
| 3118 ui_task_runner); | 3128 ui_task_runner); |
| 3119 registry->AddInterface( | 3129 registry->AddInterface( |
| (...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3646 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3656 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
| 3647 return variations::GetVariationParamValue( | 3657 return variations::GetVariationParamValue( |
| 3648 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3658 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
| 3649 } | 3659 } |
| 3650 | 3660 |
| 3651 // static | 3661 // static |
| 3652 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3662 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
| 3653 const storage::QuotaSettings* settings) { | 3663 const storage::QuotaSettings* settings) { |
| 3654 g_default_quota_settings = settings; | 3664 g_default_quota_settings = settings; |
| 3655 } | 3665 } |
| OLD | NEW |