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 3011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3063 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, | 3064 sandbox::TargetPolicy::NAMEDPIPES_ALLOW_ANY, |
3064 L"\\\\.\\pipe\\chrome.nacl.*"); | 3065 L"\\\\.\\pipe\\chrome.nacl.*"); |
3065 if (result != sandbox::SBOX_ALL_OK) | 3066 if (result != sandbox::SBOX_ALL_OK) |
3066 return false; | 3067 return false; |
3067 return result == sandbox::SBOX_ALL_OK; | 3068 return result == sandbox::SBOX_ALL_OK; |
3068 } | 3069 } |
3069 #endif // defined(OS_WIN) | 3070 #endif // defined(OS_WIN) |
3070 | 3071 |
3071 void ChromeContentBrowserClient::ExposeInterfacesToRenderer( | 3072 void ChromeContentBrowserClient::ExposeInterfacesToRenderer( |
3072 service_manager::InterfaceRegistry* registry, | 3073 service_manager::InterfaceRegistry* registry, |
| 3074 content::AssociatedInterfaceRegistry* associated_registry, |
3073 content::RenderProcessHost* render_process_host) { | 3075 content::RenderProcessHost* render_process_host) { |
| 3076 // The CacheStatsRecorder is an associated binding, instead of a |
| 3077 // non-associated one, because the sender (in the renderer process) posts the |
| 3078 // message after a time delay, in order to rate limit. The association |
| 3079 // protects against the render process host ID being recycled in that time |
| 3080 // gap between the preparation and the execution of that IPC. |
| 3081 associated_registry->AddInterface( |
| 3082 base::Bind(&CacheStatsRecorder::Create, render_process_host->GetID())); |
| 3083 |
3074 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner = | 3084 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner = |
3075 content::BrowserThread::GetTaskRunnerForThread( | 3085 content::BrowserThread::GetTaskRunnerForThread( |
3076 content::BrowserThread::UI); | 3086 content::BrowserThread::UI); |
3077 registry->AddInterface( | 3087 registry->AddInterface( |
3078 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create), | 3088 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create), |
3079 ui_task_runner); | 3089 ui_task_runner); |
3080 registry->AddInterface( | 3090 registry->AddInterface( |
3081 base::Bind(&BudgetServiceImpl::Create, render_process_host->GetID()), | 3091 base::Bind(&BudgetServiceImpl::Create, render_process_host->GetID()), |
3082 ui_task_runner); | 3092 ui_task_runner); |
3083 registry->AddInterface( | 3093 registry->AddInterface( |
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3601 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3611 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
3602 return variations::GetVariationParamValue( | 3612 return variations::GetVariationParamValue( |
3603 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3613 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
3604 } | 3614 } |
3605 | 3615 |
3606 // static | 3616 // static |
3607 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3617 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
3608 const storage::QuotaSettings* settings) { | 3618 const storage::QuotaSettings* settings) { |
3609 g_default_quota_settings = settings; | 3619 g_default_quota_settings = settings; |
3610 } | 3620 } |
OLD | NEW |