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/browser_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 #include "chrome/common/chrome_paths.h" | 74 #include "chrome/common/chrome_paths.h" |
75 #include "chrome/common/chrome_switches.h" | 75 #include "chrome/common/chrome_switches.h" |
76 #include "chrome/common/extensions/chrome_extensions_client.h" | 76 #include "chrome/common/extensions/chrome_extensions_client.h" |
77 #include "chrome/common/extensions/extension_l10n_util.h" | 77 #include "chrome/common/extensions/extension_l10n_util.h" |
78 #include "chrome/common/pref_names.h" | 78 #include "chrome/common/pref_names.h" |
79 #include "chrome/common/profile_management_switches.h" | 79 #include "chrome/common/profile_management_switches.h" |
80 #include "chrome/common/switch_utils.h" | 80 #include "chrome/common/switch_utils.h" |
81 #include "chrome/common/url_constants.h" | 81 #include "chrome/common/url_constants.h" |
82 #include "chrome/installer/util/google_update_constants.h" | 82 #include "chrome/installer/util/google_update_constants.h" |
83 #include "components/policy/core/common/policy_service.h" | 83 #include "components/policy/core/common/policy_service.h" |
| 84 #include "components/rappor/rappor_service.h" |
84 #include "content/public/browser/browser_thread.h" | 85 #include "content/public/browser/browser_thread.h" |
85 #include "content/public/browser/child_process_security_policy.h" | 86 #include "content/public/browser/child_process_security_policy.h" |
86 #include "content/public/browser/notification_details.h" | 87 #include "content/public/browser/notification_details.h" |
87 #include "content/public/browser/plugin_service.h" | 88 #include "content/public/browser/plugin_service.h" |
88 #include "content/public/browser/render_process_host.h" | 89 #include "content/public/browser/render_process_host.h" |
89 #include "content/public/browser/resource_dispatcher_host.h" | 90 #include "content/public/browser/resource_dispatcher_host.h" |
90 #include "extensions/common/constants.h" | 91 #include "extensions/common/constants.h" |
91 #include "net/socket/client_socket_pool_manager.h" | 92 #include "net/socket/client_socket_pool_manager.h" |
92 #include "net/url_request/url_request_context_getter.h" | 93 #include "net/url_request/url_request_context_getter.h" |
93 #include "ui/base/l10n/l10n_util.h" | 94 #include "ui/base/l10n/l10n_util.h" |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 #endif | 435 #endif |
435 } | 436 } |
436 | 437 |
437 MetricsService* BrowserProcessImpl::metrics_service() { | 438 MetricsService* BrowserProcessImpl::metrics_service() { |
438 DCHECK(CalledOnValidThread()); | 439 DCHECK(CalledOnValidThread()); |
439 if (!created_metrics_service_) | 440 if (!created_metrics_service_) |
440 CreateMetricsService(); | 441 CreateMetricsService(); |
441 return metrics_service_.get(); | 442 return metrics_service_.get(); |
442 } | 443 } |
443 | 444 |
| 445 rappor::RapporService* BrowserProcessImpl::rappor_service() { |
| 446 DCHECK(CalledOnValidThread()); |
| 447 if (!rappor_service_.get()) |
| 448 rappor_service_.reset(new rappor::RapporService()); |
| 449 return rappor_service_.get(); |
| 450 } |
| 451 |
444 IOThread* BrowserProcessImpl::io_thread() { | 452 IOThread* BrowserProcessImpl::io_thread() { |
445 DCHECK(CalledOnValidThread()); | 453 DCHECK(CalledOnValidThread()); |
446 DCHECK(io_thread_.get()); | 454 DCHECK(io_thread_.get()); |
447 return io_thread_.get(); | 455 return io_thread_.get(); |
448 } | 456 } |
449 | 457 |
450 WatchDogThread* BrowserProcessImpl::watchdog_thread() { | 458 WatchDogThread* BrowserProcessImpl::watchdog_thread() { |
451 DCHECK(CalledOnValidThread()); | 459 DCHECK(CalledOnValidThread()); |
452 if (!created_watchdog_thread_) | 460 if (!created_watchdog_thread_) |
453 CreateWatchdogThread(); | 461 CreateWatchdogThread(); |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 } | 1116 } |
1109 | 1117 |
1110 void BrowserProcessImpl::OnAutoupdateTimer() { | 1118 void BrowserProcessImpl::OnAutoupdateTimer() { |
1111 if (CanAutorestartForUpdate()) { | 1119 if (CanAutorestartForUpdate()) { |
1112 DLOG(WARNING) << "Detected update. Restarting browser."; | 1120 DLOG(WARNING) << "Detected update. Restarting browser."; |
1113 RestartBackgroundInstance(); | 1121 RestartBackgroundInstance(); |
1114 } | 1122 } |
1115 } | 1123 } |
1116 | 1124 |
1117 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1125 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |