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

Unified Diff: chrome/browser/media_galleries/win/mtp_device_operations_util.cc

Issue 1498003003: Remove kint64max. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: INT64_MAX 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
« no previous file with comments | « chrome/browser/internal_auth.cc ('k') | content/browser/appcache/appcache_database.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media_galleries/win/mtp_device_operations_util.cc
diff --git a/chrome/browser/media_galleries/win/mtp_device_operations_util.cc b/chrome/browser/media_galleries/win/mtp_device_operations_util.cc
index 33559c2d064f650fb798abcf2efc0cfef821b19a..ca274d8806c4e5f5ca8471d2c2827ad3d8249af8 100644
--- a/chrome/browser/media_galleries/win/mtp_device_operations_util.cc
+++ b/chrome/browser/media_galleries/win/mtp_device_operations_util.cc
@@ -5,10 +5,11 @@
#include "chrome/browser/media_galleries/win/mtp_device_operations_util.h"
#include <portabledevice.h>
+#include <stdint.h>
#include <algorithm>
+#include <limits>
-#include "base/basictypes.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/logging.h"
@@ -150,13 +151,15 @@ void GetLastModifiedTime(IPortableDeviceValues* properties_values,
// Gets the size of the file object in bytes from the property key values
// specified by the |properties_values|. On failure, return -1.
-int64 GetObjectSize(IPortableDeviceValues* properties_values) {
+int64_t GetObjectSize(IPortableDeviceValues* properties_values) {
DCHECK(properties_values);
ULONGLONG actual_size;
HRESULT hr = properties_values->GetUnsignedLargeIntegerValue(WPD_OBJECT_SIZE,
&actual_size);
- bool success = SUCCEEDED(hr) && (actual_size <= kint64max);
- return success ? static_cast<int64>(actual_size) : -1;
+ bool success = SUCCEEDED(hr) &&
+ (actual_size <=
+ static_cast<ULONGLONG>(std::numeric_limits<int64_t>::max()));
+ return success ? static_cast<int64_t>(actual_size) : -1;
}
// Gets the details of the object specified by the |object_id| given the media
@@ -167,7 +170,7 @@ bool GetObjectDetails(IPortableDevice* device,
const base::string16 object_id,
base::string16* name,
bool* is_directory,
- int64* size,
+ int64_t* size,
base::Time* last_modified_time) {
base::ThreadRestrictions::AssertIOAllowed();
DCHECK(device);
@@ -225,7 +228,7 @@ bool GetObjectDetails(IPortableDevice* device,
// Try to get the last modified time, but don't fail if we can't.
GetLastModifiedTime(properties_values.get(), last_modified_time);
- int64 object_size = GetObjectSize(properties_values.get());
+ int64_t object_size = GetObjectSize(properties_values.get());
if (object_size < 0)
return false;
*size = object_size;
@@ -241,7 +244,7 @@ MTPDeviceObjectEntry GetMTPDeviceObjectEntry(IPortableDevice* device,
DCHECK(!object_id.empty());
base::string16 name;
bool is_directory;
- int64 size;
+ int64_t size;
base::Time last_modified_time;
MTPDeviceObjectEntry entry;
if (GetObjectDetails(device, object_id, &name, &is_directory, &size,
« no previous file with comments | « chrome/browser/internal_auth.cc ('k') | content/browser/appcache/appcache_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698