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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_metrics.h

Issue 1054363002: Update DataReductionProxyNetworkDelegate/BypassStats to post tasks safely. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bengr CR comments Created 5 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 side-by-side diff with in-line comments
Download patch
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_metrics.h
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_metrics.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_metrics.h
index 22d47ed1172fd7eaea84c1a383791b9f33d24ccb..85dd909182b7a75a2a0be64629d3fb8756f2a3aa 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_metrics.h
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_metrics.h
@@ -5,7 +5,9 @@
#ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_METRICS_H_
#define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_METRICS_H_
-#include "base/time/time.h"
+#include <vector>
+
+#include "base/basictypes.h"
namespace net {
class ProxyConfig;
@@ -16,8 +18,22 @@ class PrefService;
namespace data_reduction_proxy {
+typedef std::vector<long long> ContentLengthList;
+
class DataReductionProxyConfig;
-class DataReductionProxyCompressionStats;
+
+// A bypass delay more than this is treated as a long delay.
+const int kLongBypassDelayInSeconds = 30 * 60;
+
+// The number of days of bandwidth usage statistics that are tracked.
+const unsigned int kNumDaysInHistory = 60;
+
+// The number of days of bandwidth usage statistics that are presented.
+const unsigned int kNumDaysInHistorySummary = 30;
+
+static_assert(kNumDaysInHistorySummary <= kNumDaysInHistory,
+ "kNumDaysInHistorySummary should be no larger than "
+ "kNumDaysInHistory");
enum DataReductionProxyRequestType {
VIA_DATA_REDUCTION_PROXY, // A request served by the data reduction proxy.
@@ -45,16 +61,6 @@ int64 GetAdjustedOriginalContentLength(
int64 original_content_length,
int64 received_content_length);
-// This is only exposed for testing. It is normally called by
-// UpdateContentLengthPrefs.
-void UpdateContentLengthPrefsForDataReductionProxy(
- int received_content_length,
- int original_content_length,
- bool with_data_reduction_proxy_enabled,
- DataReductionProxyRequestType request_type,
- base::Time now,
- DataReductionProxyCompressionStats* compression_stats);
-
} // namespace data_reduction_proxy
#endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_METRICS_H_

Powered by Google App Engine
This is Rietveld 408576698