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

Side by Side Diff: chrome/browser/media_galleries/linux/snapshot_file_details.cc

Issue 14247034: Move Media Galleries FileAPI code out of webkit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cr-14352004
Patch Set: Add android ifdef. Created 7 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/media_galleries/linux/snapshot_file_details.h" 5 #include "chrome/browser/media_galleries/linux/snapshot_file_details.h"
6 6
7 #include "base/safe_numerics.h" 7 #include "base/safe_numerics.h"
8 8
9 namespace chrome { 9 namespace chrome {
10 10
11 //////////////////////////////////////////////////////////////////////////////// 11 ////////////////////////////////////////////////////////////////////////////////
12 // SnapshotRequestInfo // 12 // SnapshotRequestInfo //
13 //////////////////////////////////////////////////////////////////////////////// 13 ////////////////////////////////////////////////////////////////////////////////
14 14
15 SnapshotRequestInfo::SnapshotRequestInfo( 15 SnapshotRequestInfo::SnapshotRequestInfo(
16 const std::string& device_file_path, 16 const std::string& device_file_path,
17 const base::FilePath& snapshot_file_path, 17 const base::FilePath& snapshot_file_path,
18 const fileapi::MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback& 18 const MTPDeviceAsyncDelegate::CreateSnapshotFileSuccessCallback&
19 success_callback, 19 success_callback,
20 const fileapi::MTPDeviceAsyncDelegate::ErrorCallback& error_callback) 20 const MTPDeviceAsyncDelegate::ErrorCallback& error_callback)
21 : device_file_path(device_file_path), 21 : device_file_path(device_file_path),
22 snapshot_file_path(snapshot_file_path), 22 snapshot_file_path(snapshot_file_path),
23 success_callback(success_callback), 23 success_callback(success_callback),
24 error_callback(error_callback) { 24 error_callback(error_callback) {
25 } 25 }
26 26
27 SnapshotRequestInfo::~SnapshotRequestInfo() { 27 SnapshotRequestInfo::~SnapshotRequestInfo() {
28 } 28 }
29 29
30 //////////////////////////////////////////////////////////////////////////////// 30 ////////////////////////////////////////////////////////////////////////////////
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 uint32 SnapshotFileDetails::BytesToRead() const { 64 uint32 SnapshotFileDetails::BytesToRead() const {
65 // Read data in 1MB chunks. 65 // Read data in 1MB chunks.
66 static const uint32 kReadChunkSize = 1024 * 1024; 66 static const uint32 kReadChunkSize = 1024 * 1024;
67 return std::min( 67 return std::min(
68 kReadChunkSize, 68 kReadChunkSize,
69 base::checked_numeric_cast<uint32>(file_info_.size) - bytes_written_); 69 base::checked_numeric_cast<uint32>(file_info_.size) - bytes_written_);
70 } 70 }
71 71
72 } // namespace chrome 72 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698