| 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,
|
|
|