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

Side by Side Diff: chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.cc

Issue 982283002: Implement DeleteFile and DeleteDirectory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix failed test case. Created 5 years, 9 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 // MTPDeviceDelegateImplWin implementation. 5 // MTPDeviceDelegateImplWin implementation.
6 6
7 #include "chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h" 7 #include "chrome/browser/media_galleries/win/mtp_device_delegate_impl_win.h"
8 8
9 #include <portabledevice.h> 9 #include <portabledevice.h>
10 10
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 void MTPDeviceDelegateImplWin::ReadBytes( 454 void MTPDeviceDelegateImplWin::ReadBytes(
455 const base::FilePath& device_file_path, 455 const base::FilePath& device_file_path,
456 const scoped_refptr<net::IOBuffer>& buf, 456 const scoped_refptr<net::IOBuffer>& buf,
457 int64 offset, 457 int64 offset,
458 int buf_len, 458 int buf_len,
459 const ReadBytesSuccessCallback& success_callback, 459 const ReadBytesSuccessCallback& success_callback,
460 const ErrorCallback& error_callback) { 460 const ErrorCallback& error_callback) {
461 NOTREACHED(); 461 NOTREACHED();
462 } 462 }
463 463
464 bool MTPDeviceDelegateImplWin::IsReadOnly() { 464 bool MTPDeviceDelegateImplWin::IsReadOnly() const {
465 return true; 465 return true;
466 } 466 }
467 467
468 void MTPDeviceDelegateImplWin::CopyFileFromLocal( 468 void MTPDeviceDelegateImplWin::CopyFileFromLocal(
469 const base::FilePath& source_file_path, 469 const base::FilePath& source_file_path,
470 const base::FilePath& device_file_path, 470 const base::FilePath& device_file_path,
471 const CopyFileFromLocalSuccessCallback& success_callback, 471 const CopyFileFromLocalSuccessCallback& success_callback,
472 const ErrorCallback& error_callback) { 472 const ErrorCallback& error_callback) {
473 NOTREACHED(); 473 NOTREACHED();
474 } 474 }
475 475
476 void MTPDeviceDelegateImplWin::DeleteFile(
477 const base::FilePath& file_path,
478 const DeleteFileSuccessCallback& success_callback,
479 const ErrorCallback& error_callback) {
480 NOTREACHED();
481 }
482
483 void MTPDeviceDelegateImplWin::DeleteDirectory(
484 const base::FilePath& file_path,
485 const DeleteDirectorySuccessCallback& success_callback,
486 const ErrorCallback& error_callback) {
487 NOTREACHED();
488 }
489
476 void MTPDeviceDelegateImplWin::CancelPendingTasksAndDeleteDelegate() { 490 void MTPDeviceDelegateImplWin::CancelPendingTasksAndDeleteDelegate() {
477 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 491 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
478 PortableDeviceMapService::GetInstance()->MarkPortableDeviceForDeletion( 492 PortableDeviceMapService::GetInstance()->MarkPortableDeviceForDeletion(
479 storage_device_info_.registered_device_path); 493 storage_device_info_.registered_device_path);
480 media_task_runner_->PostTask( 494 media_task_runner_->PostTask(
481 FROM_HERE, 495 FROM_HERE,
482 base::Bind(&DeletePortableDeviceOnBlockingPoolThread, 496 base::Bind(&DeletePortableDeviceOnBlockingPoolThread,
483 storage_device_info_.registered_device_path)); 497 storage_device_info_.registered_device_path));
484 while (!pending_tasks_.empty()) 498 while (!pending_tasks_.empty())
485 pending_tasks_.pop(); 499 pending_tasks_.pop();
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 current_snapshot_details_->file_info(), 642 current_snapshot_details_->file_info(),
629 current_snapshot_details_->request_info().snapshot_file_path); 643 current_snapshot_details_->request_info().snapshot_file_path);
630 } else { 644 } else {
631 current_snapshot_details_->request_info().error_callback.Run( 645 current_snapshot_details_->request_info().error_callback.Run(
632 base::File::FILE_ERROR_FAILED); 646 base::File::FILE_ERROR_FAILED);
633 } 647 }
634 task_in_progress_ = false; 648 task_in_progress_ = false;
635 current_snapshot_details_.reset(); 649 current_snapshot_details_.reset();
636 ProcessNextPendingRequest(); 650 ProcessNextPendingRequest();
637 } 651 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698