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

Side by Side Diff: chromecast/browser/metrics/external_metrics.h

Issue 845003002: [chromecast] ExternalMetrics has to destroy itself in file thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 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 CHROMECAST_BROWSER_METRICS_EXTERNAL_METRICS_H_ 5 #ifndef CHROMECAST_BROWSER_METRICS_EXTERNAL_METRICS_H_
6 #define CHROMECAST_BROWSER_METRICS_EXTERNAL_METRICS_H_ 6 #define CHROMECAST_BROWSER_METRICS_EXTERNAL_METRICS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 12 matching lines...) Expand all
23 // process to upload metrics via reading/writing to a known shared file. 23 // process to upload metrics via reading/writing to a known shared file.
24 class ExternalMetrics { 24 class ExternalMetrics {
25 public: 25 public:
26 explicit ExternalMetrics(CastStabilityMetricsProvider* stability_provider); 26 explicit ExternalMetrics(CastStabilityMetricsProvider* stability_provider);
27 ~ExternalMetrics(); 27 ~ExternalMetrics();
28 28
29 // Begins external data collection. Calls to RecordAction originate in the 29 // Begins external data collection. Calls to RecordAction originate in the
30 // File thread but are executed in the UI thread. 30 // File thread but are executed in the UI thread.
31 void Start(); 31 void Start();
32 32
33 // Destroy itself in appropriate thread.
gunsch 2015/01/09 18:56:19 nit: "Destroy" --> "Destroys"
gfhuang 2015/01/09 19:10:46 Done.
34 void DestroySelf();
35
33 private: 36 private:
34 // The max length of a message (name-value pair, plus header) 37 // The max length of a message (name-value pair, plus header)
35 static const int kMetricsMessageMaxLength = 1024; // be generous 38 static const int kMetricsMessageMaxLength = 1024; // be generous
36 39
37 // Records an external crash of the given string description. 40 // Records an external crash of the given string description.
38 void RecordCrash(const std::string& crash_kind); 41 void RecordCrash(const std::string& crash_kind);
39 42
40 // Records a sparse histogram. |sample| is expected to be a sparse histogram. 43 // Records a sparse histogram. |sample| is expected to be a sparse histogram.
41 void RecordSparseHistogram(const ::metrics::MetricSample& sample); 44 void RecordSparseHistogram(const ::metrics::MetricSample& sample);
42 45
(...skipping 17 matching lines...) Expand all
60 63
61 base::WeakPtrFactory<ExternalMetrics> weak_factory_; 64 base::WeakPtrFactory<ExternalMetrics> weak_factory_;
62 65
63 DISALLOW_COPY_AND_ASSIGN(ExternalMetrics); 66 DISALLOW_COPY_AND_ASSIGN(ExternalMetrics);
64 }; 67 };
65 68
66 } // namespace metrics 69 } // namespace metrics
67 } // namespace chromecast 70 } // namespace chromecast
68 71
69 #endif // CHROMECAST_BROWSER_METRICS_EXTERNAL_METRICS_H_ 72 #endif // CHROMECAST_BROWSER_METRICS_EXTERNAL_METRICS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698