| 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 20 matching lines...) Expand all Loading... |
| 31 #include "build/build_config.h" | 31 #include "build/build_config.h" |
| 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/budget_service/budget_service_impl.h" | 40 #include "chrome/browser/budget_service/budget_service_impl.h" |
| 41 #include "chrome/browser/cache_stats_recorder.h" |
| 41 #include "chrome/browser/chrome_content_browser_client_parts.h" | 42 #include "chrome/browser/chrome_content_browser_client_parts.h" |
| 42 #include "chrome/browser/chrome_quota_permission_context.h" | 43 #include "chrome/browser/chrome_quota_permission_context.h" |
| 43 #include "chrome/browser/content_settings/cookie_settings_factory.h" | 44 #include "chrome/browser/content_settings/cookie_settings_factory.h" |
| 44 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 45 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
| 45 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 46 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 46 #include "chrome/browser/defaults.h" | 47 #include "chrome/browser/defaults.h" |
| 47 #include "chrome/browser/download/download_prefs.h" | 48 #include "chrome/browser/download/download_prefs.h" |
| 48 #include "chrome/browser/field_trial_recorder.h" | 49 #include "chrome/browser/field_trial_recorder.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" |
| (...skipping 2995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3046 L"\\\\.\\pipe\\chrome.nacl.*"); | 3047 L"\\\\.\\pipe\\chrome.nacl.*"); |
| 3047 if (result != sandbox::SBOX_ALL_OK) | 3048 if (result != sandbox::SBOX_ALL_OK) |
| 3048 return false; | 3049 return false; |
| 3049 return result == sandbox::SBOX_ALL_OK; | 3050 return result == sandbox::SBOX_ALL_OK; |
| 3050 } | 3051 } |
| 3051 #endif // defined(OS_WIN) | 3052 #endif // defined(OS_WIN) |
| 3052 | 3053 |
| 3053 void ChromeContentBrowserClient::ExposeInterfacesToRenderer( | 3054 void ChromeContentBrowserClient::ExposeInterfacesToRenderer( |
| 3054 service_manager::InterfaceRegistry* registry, | 3055 service_manager::InterfaceRegistry* registry, |
| 3055 content::RenderProcessHost* render_process_host) { | 3056 content::RenderProcessHost* render_process_host) { |
| 3057 // The CacheStatsRecorder is an associated binding, instead of a |
| 3058 // non-associated one, because the sender (in the renderer process) posts the |
| 3059 // message after a time delay, in order to rate limit. The association |
| 3060 // protects against the render process host ID being recycled in that time |
| 3061 // gap between the preparation and the execution of that IPC. |
| 3062 render_process_host->GetChannel()->AddAssociatedInterfaceForIOThread( |
| 3063 base::Bind(&CacheStatsRecorder::Create, render_process_host->GetID())); |
| 3064 |
| 3056 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner = | 3065 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner = |
| 3057 content::BrowserThread::GetTaskRunnerForThread( | 3066 content::BrowserThread::GetTaskRunnerForThread( |
| 3058 content::BrowserThread::UI); | 3067 content::BrowserThread::UI); |
| 3059 registry->AddInterface( | 3068 registry->AddInterface( |
| 3060 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create), | 3069 base::Bind(&startup_metric_utils::StartupMetricHostImpl::Create), |
| 3061 ui_task_runner); | 3070 ui_task_runner); |
| 3062 registry->AddInterface( | 3071 registry->AddInterface( |
| 3063 base::Bind(&BudgetServiceImpl::Create, render_process_host->GetID()), | 3072 base::Bind(&BudgetServiceImpl::Create, render_process_host->GetID()), |
| 3064 ui_task_runner); | 3073 ui_task_runner); |
| 3065 registry->AddInterface( | 3074 registry->AddInterface( |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3553 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3562 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
| 3554 return variations::GetVariationParamValue( | 3563 return variations::GetVariationParamValue( |
| 3555 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3564 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
| 3556 } | 3565 } |
| 3557 | 3566 |
| 3558 // static | 3567 // static |
| 3559 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3568 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
| 3560 const storage::QuotaSettings* settings) { | 3569 const storage::QuotaSettings* settings) { |
| 3561 g_default_quota_settings = settings; | 3570 g_default_quota_settings = settings; |
| 3562 } | 3571 } |
| OLD | NEW |