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

Side by Side Diff: components/autofill/browser/autocheckout/whitelist_manager.h

Issue 14060013: Add UMA stats to track whitelist download latency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef COMPONENTS_AUTOFILL_BROWSER_AUTOCHECKOUT_WHITELIST_MANAGER_H_ 5 #ifndef COMPONENTS_AUTOFILL_BROWSER_AUTOCHECKOUT_WHITELIST_MANAGER_H_
6 #define COMPONENTS_AUTOFILL_BROWSER_AUTOCHECKOUT_WHITELIST_MANAGER_H_ 6 #define COMPONENTS_AUTOFILL_BROWSER_AUTOCHECKOUT_WHITELIST_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/timer.h" 11 #include "base/timer.h"
12 #include "components/autofill/browser/autofill_metrics.h"
12 #include "net/url_request/url_fetcher_delegate.h" 13 #include "net/url_request/url_fetcher_delegate.h"
13 14
14 class GURL; 15 class GURL;
15 16
16 namespace content { 17 namespace content {
17 class BrowserContext; 18 class BrowserContext;
18 } 19 }
19 20
20 namespace net { 21 namespace net {
21 class URLFetcher; 22 class URLFetcher;
(...skipping 20 matching lines...) Expand all
42 std::string GetMatchedURLPrefix(const GURL& url) const; 43 std::string GetMatchedURLPrefix(const GURL& url) const;
43 44
44 protected: 45 protected:
45 // Schedules a future call to TriggerDownload if one isn't already pending. 46 // Schedules a future call to TriggerDownload if one isn't already pending.
46 virtual void ScheduleDownload(size_t interval_seconds); 47 virtual void ScheduleDownload(size_t interval_seconds);
47 48
48 // Start the download timer. It is called by ScheduleDownload(), and exposed 49 // Start the download timer. It is called by ScheduleDownload(), and exposed
49 // as a separate method for mocking out in tests. 50 // as a separate method for mocking out in tests.
50 virtual void StartDownloadTimer(size_t interval_seconds); 51 virtual void StartDownloadTimer(size_t interval_seconds);
51 52
53 // Returns the |AutofillMetrics| instance that should be used for logging
ahutter 2013/04/16 17:56:54 Take a look at autocheckout_manager.h. Might be go
benquan 2013/04/17 01:51:30 I was following autocheckout_request_manager.h and
54 // Autocheckout whitelist file downloading.
55 virtual const AutofillMetrics& GetMetricLogger() const {
56 return metrics_logger_;
Ilya Sherman 2013/04/17 00:18:01 nit: virtual method implementations belong in the
benquan 2013/04/17 01:51:30 Done.
57 }
58
52 // Timer callback indicating it's time to download whitelist from server. 59 // Timer callback indicating it's time to download whitelist from server.
53 void TriggerDownload(); 60 void TriggerDownload();
54 61
55 // Used by tests only. 62 // Used by tests only.
56 void StopDownloadTimer(); 63 void StopDownloadTimer();
57 64
58 const std::vector<std::string>& url_prefixes() const { 65 const std::vector<std::string>& url_prefixes() const {
59 return url_prefixes_; 66 return url_prefixes_;
60 } 67 }
61 68
(...skipping 14 matching lines...) Expand all
76 83
77 // The context for the request. 84 // The context for the request.
78 net::URLRequestContextGetter* context_getter_; // WEAK 85 net::URLRequestContextGetter* context_getter_; // WEAK
79 86
80 // State of the kEnableExperimentalFormFilling flag. 87 // State of the kEnableExperimentalFormFilling flag.
81 const bool experimental_form_filling_enabled_; 88 const bool experimental_form_filling_enabled_;
82 89
83 // State of the kBypassAutocheckoutWhitelist flag. 90 // State of the kBypassAutocheckoutWhitelist flag.
84 const bool bypass_autocheckout_whitelist_; 91 const bool bypass_autocheckout_whitelist_;
85 92
93 // Metrics Logging stuff.
ahutter 2013/04/16 17:56:54 "Logger for UMA metrics" or something like that.
benquan 2013/04/17 01:51:30 Done.
94 AutofillMetrics metrics_logger_;
ahutter 2013/04/16 17:56:54 new line after this.
benquan 2013/04/17 01:51:30 Done.
95 // When the whitelist download started. Used to track download latency.
96 base::Time request_started_timestamp_;
97
86 // The request object. 98 // The request object.
87 scoped_ptr<net::URLFetcher> request_; 99 scoped_ptr<net::URLFetcher> request_;
88 100
89 DISALLOW_COPY_AND_ASSIGN(WhitelistManager); 101 DISALLOW_COPY_AND_ASSIGN(WhitelistManager);
90 }; 102 };
91 103
92 } // namespace autocheckout 104 } // namespace autocheckout
93 } // namespace autofill 105 } // namespace autofill
94 106
95 #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOCHECKOUT_WHITELIST_MANAGER_H_ 107 #endif // COMPONENTS_AUTOFILL_BROWSER_AUTOCHECKOUT_WHITELIST_MANAGER_H_
96 108
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698