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

Unified Diff: components/data_use_measurement/core/data_use.cc

Issue 2947973002: Support moving pending requests from one DataUseRecorder to another (Closed)
Patch Set: rebase Created 3 years, 6 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_use_measurement/core/data_use.cc
diff --git a/components/data_use_measurement/core/data_use.cc b/components/data_use_measurement/core/data_use.cc
index 9c34e8a8ce2faf750ca0624e44df7db2576a1699..8750f45e2bf4c5e001c0eb8ecacad2ff4fbc4f65 100644
--- a/components/data_use_measurement/core/data_use.cc
+++ b/components/data_use_measurement/core/data_use.cc
@@ -16,15 +16,8 @@ DataUse::~DataUse() {}
void DataUse::IncrementTotalBytes(int64_t bytes_received, int64_t bytes_sent) {
total_bytes_received_ += bytes_received;
total_bytes_sent_ += bytes_sent;
-}
-
-void DataUse::MergeFrom(const DataUse& other) {
- // Traffic type need not be same while merging. One of the data use created
- // when mainframe is created could have UNKNOWN traffic type, and later merged
- // with the data use created for its mainframe request which could be
- // USER_TRAFFIC.
- total_bytes_sent_ += other.total_bytes_sent_;
- total_bytes_received_ += other.total_bytes_received_;
+ DCHECK_LE(0, total_bytes_received_);
+ DCHECK_LE(0, total_bytes_sent_);
}
} // namespace data_use_measurement
« no previous file with comments | « components/data_use_measurement/core/data_use.h ('k') | components/data_use_measurement/core/data_use_recorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698