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

Unified Diff: base/debug/activity_tracker.cc

Issue 2738493004: Support zero-sized values. (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | base/debug/activity_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/activity_tracker.cc
diff --git a/base/debug/activity_tracker.cc b/base/debug/activity_tracker.cc
index 09946eed7296a2088f152b30ab46b513ea6dcf05..40e9b9537ca9cdd739f6f2ee5826f1032f6aa7fa 100644
--- a/base/debug/activity_tracker.cc
+++ b/base/debug/activity_tracker.cc
@@ -331,9 +331,11 @@ void ActivityUserData::Set(StringPiece name,
// Truncate the stored size to the amount of available memory. Stop now if
// there's not any room for even part of the value.
- size = std::min(full_size - base_size, size);
- if (size == 0)
- return;
+ if (size != 0) {
+ size = std::min(full_size - base_size, size);
+ if (size == 0)
+ return;
+ }
// Allocate a chunk of memory.
Header* header = reinterpret_cast<Header*>(memory_);
« no previous file with comments | « no previous file | base/debug/activity_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698