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

Side by Side Diff: components/browser_watcher/watcher_metrics_provider_win.h

Issue 1630923002: Remove PRODUCT_STRING_PATH from chrome_constants.h on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@c2_rm_PSP_profile_resetter
Patch Set: Created 4 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
OLDNEW
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2014 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_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_ 5 #ifndef COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_
6 #define COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_ 6 #define COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/task_runner.h" 10 #include "base/task_runner.h"
11 #include "components/metrics/metrics_provider.h" 11 #include "components/metrics/metrics_provider.h"
12 12
13 namespace browser_watcher { 13 namespace browser_watcher {
14 14
15 // Provides stability data captured by the Chrome Watcher, namely the browser 15 // Provides stability data captured by the Chrome Watcher, namely the browser
16 // process exit codes. 16 // process exit codes.
17 class WatcherMetricsProviderWin : public metrics::MetricsProvider { 17 class WatcherMetricsProviderWin : public metrics::MetricsProvider {
18 public: 18 public:
19 static const char kBrowserExitCodeHistogramName[]; 19 static const char kBrowserExitCodeHistogramName[];
20 20
21 // Initializes the reporter. |cleanup_io_task_runner| is used to clear 21 // Initializes the reporter. |cleanup_io_task_runner| is used to clear
22 // leftover data in registry if metrics reporting is disabled. 22 // leftover data in registry if metrics reporting is disabled.
23 WatcherMetricsProviderWin(const base::char16* registry_path, 23 WatcherMetricsProviderWin(const base::string16& registry_path,
Sigurður Ásgeirsson 2016/01/25 20:50:24 this'll force an extra copy. No biggie except we f
gab 2016/01/26 02:55:05 I don't think it does as the char* were replaced b
grt (UTC plus 2) 2016/01/26 16:13:04 I like the StringPiece suggestion since it doesn't
24 base::TaskRunner* cleanup_io_task_runner); 24 base::TaskRunner* cleanup_io_task_runner);
25 ~WatcherMetricsProviderWin() override; 25 ~WatcherMetricsProviderWin() override;
26 26
27 // metrics::MetricsProvider implementation. 27 // metrics::MetricsProvider implementation.
28 void OnRecordingEnabled() override; 28 void OnRecordingEnabled() override;
29 void OnRecordingDisabled() override; 29 void OnRecordingDisabled() override;
30 void ProvideStabilityMetrics( 30 void ProvideStabilityMetrics(
31 metrics::SystemProfileProto* system_profile_proto) override; 31 metrics::SystemProfileProto* system_profile_proto) override;
32 32
33 private: 33 private:
34 bool recording_enabled_; 34 bool recording_enabled_;
35 bool cleanup_scheduled_; 35 bool cleanup_scheduled_;
36 base::string16 registry_path_; 36 const base::string16 registry_path_;
37 scoped_refptr<base::TaskRunner> cleanup_io_task_runner_; 37 scoped_refptr<base::TaskRunner> cleanup_io_task_runner_;
38 38
39 DISALLOW_COPY_AND_ASSIGN(WatcherMetricsProviderWin); 39 DISALLOW_COPY_AND_ASSIGN(WatcherMetricsProviderWin);
40 }; 40 };
41 41
42 } // namespace browser_watcher 42 } // namespace browser_watcher
43 43
44 #endif // COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_ 44 #endif // COMPONENTS_BROWSER_WATCHER_WATCHER_METRICS_PROVIDER_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698