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

Side by Side Diff: chrome/browser/media_galleries/fileapi/device_media_async_file_util.cc

Issue 1550593002: Switch to standard integer types in chrome/browser/, part 2 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 #include "chrome/browser/media_galleries/fileapi/device_media_async_file_util.h" 5 #include "chrome/browser/media_galleries/fileapi/device_media_async_file_util.h"
6 6
7 #include <stddef.h>
8
7 #include "base/callback.h" 9 #include "base/callback.h"
8 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
11 #include "base/macros.h"
9 #include "base/single_thread_task_runner.h" 12 #include "base/single_thread_task_runner.h"
10 #include "base/task_runner_util.h" 13 #include "base/task_runner_util.h"
11 #include "chrome/browser/media_galleries/fileapi/media_path_filter.h" 14 #include "chrome/browser/media_galleries/fileapi/media_path_filter.h"
12 #include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h" 15 #include "chrome/browser/media_galleries/fileapi/mtp_device_async_delegate.h"
13 #include "chrome/browser/media_galleries/fileapi/mtp_device_map_service.h" 16 #include "chrome/browser/media_galleries/fileapi/mtp_device_map_service.h"
14 #include "chrome/browser/media_galleries/fileapi/mtp_file_stream_reader.h" 17 #include "chrome/browser/media_galleries/fileapi/mtp_file_stream_reader.h"
15 #include "chrome/browser/media_galleries/fileapi/native_media_file_util.h" 18 #include "chrome/browser/media_galleries/fileapi/native_media_file_util.h"
16 #include "chrome/browser/media_galleries/fileapi/readahead_file_stream_reader.h" 19 #include "chrome/browser/media_galleries/fileapi/readahead_file_stream_reader.h"
17 #include "content/public/browser/browser_thread.h" 20 #include "content/public/browser/browser_thread.h"
18 #include "storage/browser/blob/shareable_file_reference.h" 21 #include "storage/browser/blob/shareable_file_reference.h"
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 const base::Time& last_modified_time, 404 const base::Time& last_modified_time,
402 const StatusCallback& callback) { 405 const StatusCallback& callback) {
403 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 406 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
404 NOTIMPLEMENTED(); 407 NOTIMPLEMENTED();
405 callback.Run(base::File::FILE_ERROR_SECURITY); 408 callback.Run(base::File::FILE_ERROR_SECURITY);
406 } 409 }
407 410
408 void DeviceMediaAsyncFileUtil::Truncate( 411 void DeviceMediaAsyncFileUtil::Truncate(
409 scoped_ptr<FileSystemOperationContext> context, 412 scoped_ptr<FileSystemOperationContext> context,
410 const FileSystemURL& url, 413 const FileSystemURL& url,
411 int64 length, 414 int64_t length,
412 const StatusCallback& callback) { 415 const StatusCallback& callback) {
413 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 416 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
414 NOTIMPLEMENTED(); 417 NOTIMPLEMENTED();
415 callback.Run(base::File::FILE_ERROR_SECURITY); 418 callback.Run(base::File::FILE_ERROR_SECURITY);
416 } 419 }
417 420
418 void DeviceMediaAsyncFileUtil::CopyFileLocal( 421 void DeviceMediaAsyncFileUtil::CopyFileLocal(
419 scoped_ptr<FileSystemOperationContext> context, 422 scoped_ptr<FileSystemOperationContext> context,
420 const FileSystemURL& src_url, 423 const FileSystemURL& src_url,
421 const FileSystemURL& dest_url, 424 const FileSystemURL& dest_url,
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 base::PostTaskAndReplyWithResult( 563 base::PostTaskAndReplyWithResult(
561 task_runner.get(), FROM_HERE, 564 task_runner.get(), FROM_HERE,
562 base::Bind(&CreateSnapshotFileOnBlockingPool, profile_path_), 565 base::Bind(&CreateSnapshotFileOnBlockingPool, profile_path_),
563 base::Bind(&OnSnapshotFileCreatedRunTask, base::Passed(&context), 566 base::Bind(&OnSnapshotFileCreatedRunTask, base::Passed(&context),
564 callback, url, validate_media_files())); 567 callback, url, validate_media_files()));
565 } 568 }
566 569
567 scoped_ptr<storage::FileStreamReader> 570 scoped_ptr<storage::FileStreamReader>
568 DeviceMediaAsyncFileUtil::GetFileStreamReader( 571 DeviceMediaAsyncFileUtil::GetFileStreamReader(
569 const FileSystemURL& url, 572 const FileSystemURL& url,
570 int64 offset, 573 int64_t offset,
571 const base::Time& expected_modification_time, 574 const base::Time& expected_modification_time,
572 storage::FileSystemContext* context) { 575 storage::FileSystemContext* context) {
573 MTPDeviceAsyncDelegate* delegate = GetMTPDeviceDelegate(url); 576 MTPDeviceAsyncDelegate* delegate = GetMTPDeviceDelegate(url);
574 if (!delegate) 577 if (!delegate)
575 return scoped_ptr<storage::FileStreamReader>(); 578 return scoped_ptr<storage::FileStreamReader>();
576 579
577 DCHECK(delegate->IsStreaming()); 580 DCHECK(delegate->IsStreaming());
578 return scoped_ptr<storage::FileStreamReader>(new ReadaheadFileStreamReader( 581 return scoped_ptr<storage::FileStreamReader>(new ReadaheadFileStreamReader(
579 new MTPFileStreamReader(context, 582 new MTPFileStreamReader(context,
580 url, 583 url,
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 void DeviceMediaAsyncFileUtil::OnDidDeleteDirectory( 702 void DeviceMediaAsyncFileUtil::OnDidDeleteDirectory(
700 const StatusCallback& callback) { 703 const StatusCallback& callback) {
701 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 704 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
702 705
703 callback.Run(base::File::FILE_OK); 706 callback.Run(base::File::FILE_OK);
704 } 707 }
705 708
706 bool DeviceMediaAsyncFileUtil::validate_media_files() const { 709 bool DeviceMediaAsyncFileUtil::validate_media_files() const {
707 return media_path_filter_wrapper_.get() != NULL; 710 return media_path_filter_wrapper_.get() != NULL;
708 } 711 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698