Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_service.cc

Issue 11785014: Record metrics for slow startups (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Android/Linux Aurora compile failure Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/safe_browsing/database_manager.cc ('k') | chrome/common/startup_metric_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 17 matching lines...) Expand all
28 #include "chrome/browser/safe_browsing/malware_details.h" 28 #include "chrome/browser/safe_browsing/malware_details.h"
29 #include "chrome/browser/safe_browsing/ping_manager.h" 29 #include "chrome/browser/safe_browsing/ping_manager.h"
30 #include "chrome/browser/safe_browsing/protocol_manager.h" 30 #include "chrome/browser/safe_browsing/protocol_manager.h"
31 #include "chrome/browser/safe_browsing/safe_browsing_database.h" 31 #include "chrome/browser/safe_browsing/safe_browsing_database.h"
32 #include "chrome/browser/safe_browsing/ui_manager.h" 32 #include "chrome/browser/safe_browsing/ui_manager.h"
33 #include "chrome/common/chrome_constants.h" 33 #include "chrome/common/chrome_constants.h"
34 #include "chrome/common/chrome_notification_types.h" 34 #include "chrome/common/chrome_notification_types.h"
35 #include "chrome/common/chrome_paths.h" 35 #include "chrome/common/chrome_paths.h"
36 #include "chrome/common/chrome_switches.h" 36 #include "chrome/common/chrome_switches.h"
37 #include "chrome/common/pref_names.h" 37 #include "chrome/common/pref_names.h"
38 #include "chrome/common/startup_metric_utils.h"
38 #include "chrome/common/url_constants.h" 39 #include "chrome/common/url_constants.h"
39 #include "content/public/browser/browser_thread.h" 40 #include "content/public/browser/browser_thread.h"
40 #include "content/public/browser/notification_service.h" 41 #include "content/public/browser/notification_service.h"
41 #include "net/cookies/cookie_monster.h" 42 #include "net/cookies/cookie_monster.h"
42 #include "net/url_request/url_request_context.h" 43 #include "net/url_request/url_request_context.h"
43 #include "net/url_request/url_request_context_getter.h" 44 #include "net/url_request/url_request_context_getter.h"
44 45
45 #if defined(OS_WIN) 46 #if defined(OS_WIN)
46 #include "chrome/installer/util/browser_distribution.h" 47 #include "chrome/installer/util/browser_distribution.h"
47 #endif 48 #endif
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 enabled_(false) { 158 enabled_(false) {
158 } 159 }
159 160
160 SafeBrowsingService::~SafeBrowsingService() { 161 SafeBrowsingService::~SafeBrowsingService() {
161 // We should have already been shut down. If we're still enabled, then the 162 // We should have already been shut down. If we're still enabled, then the
162 // database isn't going to be closed properly, which could lead to corruption. 163 // database isn't going to be closed properly, which could lead to corruption.
163 DCHECK(!enabled_); 164 DCHECK(!enabled_);
164 } 165 }
165 166
166 void SafeBrowsingService::Initialize() { 167 void SafeBrowsingService::Initialize() {
168 startup_metric_utils::ScopedSlowStartupUMA
169 scoped_timer("Startup.SlowStartupSafeBrowsingServiceInitialize");
170
167 url_request_context_getter_ = 171 url_request_context_getter_ =
168 new SafeBrowsingURLRequestContextGetter(this); 172 new SafeBrowsingURLRequestContextGetter(this);
169 173
170 ui_manager_ = CreateUIManager(); 174 ui_manager_ = CreateUIManager();
171 175
172 database_manager_ = CreateDatabaseManager(); 176 database_manager_ = CreateDatabaseManager();
173 177
174 BrowserThread::PostTask( 178 BrowserThread::PostTask(
175 BrowserThread::IO, FROM_HERE, 179 BrowserThread::IO, FROM_HERE,
176 base::Bind( 180 base::Bind(
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
460 #if defined(FULL_SAFE_BROWSING) 464 #if defined(FULL_SAFE_BROWSING)
461 if (csd_service_.get()) 465 if (csd_service_.get())
462 csd_service_->SetEnabledAndRefreshState(enable); 466 csd_service_->SetEnabledAndRefreshState(enable);
463 if (download_service_.get()) { 467 if (download_service_.get()) {
464 download_service_->SetEnabled( 468 download_service_->SetEnabled(
465 enable && !CommandLine::ForCurrentProcess()->HasSwitch( 469 enable && !CommandLine::ForCurrentProcess()->HasSwitch(
466 switches::kDisableImprovedDownloadProtection)); 470 switches::kDisableImprovedDownloadProtection));
467 } 471 }
468 #endif 472 #endif
469 } 473 }
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/database_manager.cc ('k') | chrome/common/startup_metric_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698