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

Unified Diff: components/data_usage/core/data_use.h

Issue 1373373002: Create component to expose network usage stats to consumers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nits Created 5 years, 2 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
« no previous file with comments | « components/data_usage/core/DEPS ('k') | components/data_usage/core/data_use.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/data_usage/core/data_use.h
diff --git a/components/data_usage/core/data_use.h b/components/data_usage/core/data_use.h
new file mode 100644
index 0000000000000000000000000000000000000000..4c0c5c1a7ff7b332a3b5de5944c57f3e3431b279
--- /dev/null
+++ b/components/data_usage/core/data_use.h
@@ -0,0 +1,40 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_DATA_USAGE_CORE_DATA_USE_H_
+#define COMPONENTS_DATA_USAGE_CORE_DATA_USE_H_
+
+#include <stdint.h>
+
+#include "base/time/time.h"
+#include "net/base/network_change_notifier.h"
+#include "url/gurl.h"
+
+namespace data_usage {
+
+struct DataUse {
+ DataUse(const GURL& url,
+ const base::Time& request_time,
+ const GURL& first_party_for_cookies,
+ int32_t tab_id,
+ net::NetworkChangeNotifier::ConnectionType connection_type,
+ int64_t tx_bytes,
+ int64_t rx_bytes);
+
+ GURL url;
+ // The time when the request that is associated with these bytes was started.
+ base::Time request_time;
+ GURL first_party_for_cookies;
+ int32_t tab_id;
+ net::NetworkChangeNotifier::ConnectionType connection_type;
+ // TODO(sclittle): Add more network info here, e.g. for Android, SIM operator
+ // and whether the device is roaming.
+
+ int64_t tx_bytes;
+ int64_t rx_bytes;
+};
+
+} // namespace data_usage
+
+#endif // COMPONENTS_DATA_USAGE_CORE_DATA_USE_H_
« no previous file with comments | « components/data_usage/core/DEPS ('k') | components/data_usage/core/data_use.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698