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

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

Issue 14093019: Linux/CrOS: In the MTPDeviceDelegate, use the right variable when handling 0-byte files. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/mtp_device_delegate_impl_linux.h" 5 #include "chrome/browser/media_galleries/linux/mtp_device_delegate_impl_linux.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 397
398 base::PlatformFileInfo snapshot_file_info(file_info); 398 base::PlatformFileInfo snapshot_file_info(file_info);
399 // Modify the last modified time to null. This prevents the time stamp 399 // Modify the last modified time to null. This prevents the time stamp
400 // verfication in LocalFileStreamReader. 400 // verfication in LocalFileStreamReader.
401 snapshot_file_info.last_modified = base::Time(); 401 snapshot_file_info.last_modified = base::Time();
402 402
403 current_snapshot_request_info_.reset(snapshot_request_info.release()); 403 current_snapshot_request_info_.reset(snapshot_request_info.release());
404 if (file_info.size == 0) { 404 if (file_info.size == 0) {
405 // Empty snapshot file. 405 // Empty snapshot file.
406 return OnDidWriteDataIntoSnapshotFile( 406 return OnDidWriteDataIntoSnapshotFile(
407 snapshot_file_info, snapshot_request_info->snapshot_file_path); 407 snapshot_file_info, current_snapshot_request_info_->snapshot_file_path);
Lei Zhang 2013/04/17 22:52:27 We just released |snapshot_request_info| 3 line up
408 } 408 }
409 WriteDataIntoSnapshotFile(snapshot_file_info); 409 WriteDataIntoSnapshotFile(snapshot_file_info);
410 } 410 }
411 411
412 void MTPDeviceDelegateImplLinux::OnDidReadDirectory( 412 void MTPDeviceDelegateImplLinux::OnDidReadDirectory(
413 const ReadDirectorySuccessCallback& success_callback, 413 const ReadDirectorySuccessCallback& success_callback,
414 const fileapi::AsyncFileUtil::EntryList& file_list) { 414 const fileapi::AsyncFileUtil::EntryList& file_list) {
415 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 415 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
416 success_callback.Run(file_list, false /*no more entries*/); 416 success_callback.Run(file_list, false /*no more entries*/);
417 task_in_progress_ = false; 417 task_in_progress_ = false;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 } 452 }
453 453
454 void CreateMTPDeviceAsyncDelegate( 454 void CreateMTPDeviceAsyncDelegate(
455 const std::string& device_location, 455 const std::string& device_location,
456 const CreateMTPDeviceAsyncDelegateCallback& callback) { 456 const CreateMTPDeviceAsyncDelegateCallback& callback) {
457 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); 457 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
458 callback.Run(new MTPDeviceDelegateImplLinux(device_location)); 458 callback.Run(new MTPDeviceDelegateImplLinux(device_location));
459 } 459 }
460 460
461 } // namespace chrome 461 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698