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

Unified Diff: components/history/core/browser/delete_directive_handler.cc

Issue 1548113002: Switch to standard integer types in components/, part 2 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn Created 5 years 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/history/core/browser/delete_directive_handler.cc
diff --git a/components/history/core/browser/delete_directive_handler.cc b/components/history/core/browser/delete_directive_handler.cc
index 71d7f03a60e30da322e32792ffee1238bccac997..cfd4f478d8f7a00e44226d1b478a4d35ed4a681f 100644
--- a/components/history/core/browser/delete_directive_handler.cc
+++ b/components/history/core/browser/delete_directive_handler.cc
@@ -4,6 +4,8 @@
#include "components/history/core/browser/delete_directive_handler.h"
+#include <stddef.h>
+
#include "base/json/json_writer.h"
#include "base/rand_util.h"
#include "base/time/time.h"
@@ -51,12 +53,12 @@ bool TimeRangeLessThan(const syncer::SyncData& data1,
}
// Converts a Unix timestamp in microseconds to a base::Time value.
-base::Time UnixUsecToTime(int64 usec) {
+base::Time UnixUsecToTime(int64_t usec) {
return base::Time::UnixEpoch() + base::TimeDelta::FromMicroseconds(usec);
}
// Converts a base::Time value to a Unix timestamp in microseconds.
-int64 TimeToUnixUsec(base::Time time) {
+int64_t TimeToUnixUsec(base::Time time) {
DCHECK(!time.is_null());
return (time - base::Time::UnixEpoch()).InMicroseconds();
}
@@ -311,21 +313,21 @@ void DeleteDirectiveHandler::Stop() {
}
bool DeleteDirectiveHandler::CreateDeleteDirectives(
- const std::set<int64>& global_ids,
+ const std::set<int64_t>& global_ids,
base::Time begin_time,
base::Time end_time) {
base::Time now = base::Time::Now();
sync_pb::HistoryDeleteDirectiveSpecifics delete_directive;
// Delete directives require a non-null begin time, so use 1 if it's null.
- int64 begin_time_usecs =
+ int64_t begin_time_usecs =
begin_time.is_null() ? 0 : TimeToUnixUsec(begin_time);
// Determine the actual end time -- it should not be null or in the future.
// TODO(dubroy): Use sane time (crbug.com/146090) here when it's available.
base::Time end = (end_time.is_null() || end_time > now) ? now : end_time;
// -1 because end time in delete directives is inclusive.
- int64 end_time_usecs = TimeToUnixUsec(end) - 1;
+ int64_t end_time_usecs = TimeToUnixUsec(end) - 1;
if (global_ids.empty()) {
sync_pb::TimeRangeDirective* time_range_directive =
@@ -333,7 +335,7 @@ bool DeleteDirectiveHandler::CreateDeleteDirectives(
time_range_directive->set_start_time_usec(begin_time_usecs);
time_range_directive->set_end_time_usec(end_time_usecs);
} else {
- for (std::set<int64>::const_iterator it = global_ids.begin();
+ for (std::set<int64_t>::const_iterator it = global_ids.begin();
it != global_ids.end(); ++it) {
sync_pb::GlobalIdDirective* global_id_directive =
delete_directive.mutable_global_id_directive();
« no previous file with comments | « components/history/core/browser/delete_directive_handler.h ('k') | components/history/core/browser/download_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698