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/router/media_router_feature.h" | 51 #include "chrome/browser/media/router/media_router_feature.h" |
51 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" | 52 #include "chrome/browser/media/router/presentation_service_delegate_impl.h" |
(...skipping 3038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3090 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, | 3091 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, |
3091 L"\\\\.\\pipe\\chrome.nacl.*"); | 3092 L"\\\\.\\pipe\\chrome.nacl.*"); |
3092 if (result != sandbox::SBOX_ALL_OK) | 3093 if (result != sandbox::SBOX_ALL_OK) |
3093 return false; | 3094 return false; |
3094 return result == sandbox::SBOX_ALL_OK; | 3095 return result == sandbox::SBOX_ALL_OK; |
3095 } | 3096 } |
3096 #endif // defined(OS_WIN) | 3097 #endif // defined(OS_WIN) |
3097 | 3098 |
3098 void ChromeContentBrowserClient::ExposeInterfacesToRenderer( | 3099 void ChromeContentBrowserClient::ExposeInterfacesToRenderer( |
3099 service_manager::BinderRegistry* registry, | 3100 service_manager::BinderRegistry* registry, |
| 3101 content::AssociatedInterfaceRegistry* associated_registry, |
3100 content::RenderProcessHost* render_process_host) { | 3102 content::RenderProcessHost* render_process_host) { |
| 3103 // The CacheStatsRecorder is an associated binding, instead of a |
| 3104 // non-associated one, because the sender (in the renderer process) posts the |
| 3105 // message after a time delay, in order to rate limit. The association |
| 3106 // protects against the render process host ID being recycled in that time |
| 3107 // gap between the preparation and the execution of that IPC. |
| 3108 associated_registry->AddInterface( |
| 3109 base::Bind(&CacheStatsRecorder::Create, render_process_host->GetID())); |
| 3110 |
3101 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner = | 3111 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner = |
3102 content::BrowserThread::GetTaskRunnerForThread( | 3112 content::BrowserThread::GetTaskRunnerForThread( |
3103 content::BrowserThread::UI); | 3113 content::BrowserThread::UI); |
3104 registry->AddInterface( | 3114 registry->AddInterface( |
3105 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create), | 3115 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create), |
3106 ui_task_runner); | 3116 ui_task_runner); |
3107 registry->AddInterface( | 3117 registry->AddInterface( |
3108 base::Bind(&BudgetServiceImpl::Create, render_process_host->GetID()), | 3118 base::Bind(&BudgetServiceImpl::Create, render_process_host->GetID()), |
3109 ui_task_runner); | 3119 ui_task_runner); |
3110 registry->AddInterface( | 3120 registry->AddInterface( |
(...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3625 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3635 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
3626 return variations::GetVariationParamValue( | 3636 return variations::GetVariationParamValue( |
3627 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3637 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
3628 } | 3638 } |
3629 | 3639 |
3630 // static | 3640 // static |
3631 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3641 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
3632 const storage::QuotaSettings* settings) { | 3642 const storage::QuotaSettings* settings) { |
3633 g_default_quota_settings = settings; | 3643 g_default_quota_settings = settings; |
3634 } | 3644 } |
OLD | NEW |