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/safe_browsing/safe_browsing_service.h" | 5 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "chrome/browser/safe_browsing/malware_details.h" | 31 #include "chrome/browser/safe_browsing/malware_details.h" |
32 #include "chrome/browser/safe_browsing/ping_manager.h" | 32 #include "chrome/browser/safe_browsing/ping_manager.h" |
33 #include "chrome/browser/safe_browsing/protocol_manager.h" | 33 #include "chrome/browser/safe_browsing/protocol_manager.h" |
34 #include "chrome/browser/safe_browsing/safe_browsing_database.h" | 34 #include "chrome/browser/safe_browsing/safe_browsing_database.h" |
35 #include "chrome/browser/safe_browsing/ui_manager.h" | 35 #include "chrome/browser/safe_browsing/ui_manager.h" |
36 #include "chrome/common/chrome_constants.h" | 36 #include "chrome/common/chrome_constants.h" |
37 #include "chrome/common/chrome_paths.h" | 37 #include "chrome/common/chrome_paths.h" |
38 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
39 #include "chrome/common/pref_names.h" | 39 #include "chrome/common/pref_names.h" |
40 #include "chrome/common/url_constants.h" | 40 #include "chrome/common/url_constants.h" |
41 #include "components/metrics/metrics_service.h" | |
42 #include "components/startup_metric_utils/startup_metric_utils.h" | 41 #include "components/startup_metric_utils/startup_metric_utils.h" |
| 42 #include "components/variations/variations_associated_data.h" |
43 #include "content/public/browser/browser_thread.h" | 43 #include "content/public/browser/browser_thread.h" |
44 #include "content/public/browser/cookie_crypto_delegate.h" | 44 #include "content/public/browser/cookie_crypto_delegate.h" |
45 #include "content/public/browser/cookie_store_factory.h" | 45 #include "content/public/browser/cookie_store_factory.h" |
46 #include "content/public/browser/notification_service.h" | 46 #include "content/public/browser/notification_service.h" |
47 #include "net/cookies/cookie_monster.h" | 47 #include "net/cookies/cookie_monster.h" |
48 #include "net/url_request/url_request_context.h" | 48 #include "net/url_request/url_request_context.h" |
49 #include "net/url_request/url_request_context_getter.h" | 49 #include "net/url_request/url_request_context_getter.h" |
50 | 50 |
51 #if defined(OS_WIN) | 51 #if defined(OS_WIN) |
52 #include "chrome/installer/util/browser_distribution.h" | 52 #include "chrome/installer/util/browser_distribution.h" |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 // Check if any profile requires the service to be active. | 588 // Check if any profile requires the service to be active. |
589 bool enable = false; | 589 bool enable = false; |
590 std::map<PrefService*, PrefChangeRegistrar*>::iterator iter; | 590 std::map<PrefService*, PrefChangeRegistrar*>::iterator iter; |
591 for (iter = prefs_map_.begin(); iter != prefs_map_.end(); ++iter) { | 591 for (iter = prefs_map_.begin(); iter != prefs_map_.end(); ++iter) { |
592 if (iter->first->GetBoolean(prefs::kSafeBrowsingEnabled)) { | 592 if (iter->first->GetBoolean(prefs::kSafeBrowsingEnabled)) { |
593 enable = true; | 593 enable = true; |
594 break; | 594 break; |
595 } | 595 } |
596 } | 596 } |
597 | 597 |
| 598 // TODO(asvitkine): Experimental code for measuring start up impact of SB. |
| 599 // Remove when experimentation is complete. http://crbug.com/450037 |
| 600 if (!variations::GetVariationParamValue("LightSpeed", "DisableSB").empty()) |
| 601 enable = false; |
| 602 |
598 if (enable) | 603 if (enable) |
599 Start(); | 604 Start(); |
600 else | 605 else |
601 Stop(false); | 606 Stop(false); |
602 | 607 |
603 #if defined(FULL_SAFE_BROWSING) | 608 #if defined(FULL_SAFE_BROWSING) |
604 if (csd_service_) | 609 if (csd_service_) |
605 csd_service_->SetEnabledAndRefreshState(enable); | 610 csd_service_->SetEnabledAndRefreshState(enable); |
606 if (download_service_) | 611 if (download_service_) |
607 download_service_->SetEnabled(enable); | 612 download_service_->SetEnabled(enable); |
608 #endif | 613 #endif |
609 } | 614 } |
OLD | NEW |