OLD | NEW |
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/fileapi/native_media_file_util.h" | 5 #include "chrome/browser/media_galleries/fileapi/native_media_file_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 FROM_HERE, | 160 FROM_HERE, |
161 base::Bind(&NativeMediaFileUtil::CreateDirectoryOnTaskRunnerThread, | 161 base::Bind(&NativeMediaFileUtil::CreateDirectoryOnTaskRunnerThread, |
162 weak_factory_.GetWeakPtr(), base::Passed(&context), | 162 weak_factory_.GetWeakPtr(), base::Passed(&context), |
163 url, exclusive, recursive, callback)); | 163 url, exclusive, recursive, callback)); |
164 DCHECK(success); | 164 DCHECK(success); |
165 } | 165 } |
166 | 166 |
167 void NativeMediaFileUtil::GetFileInfo( | 167 void NativeMediaFileUtil::GetFileInfo( |
168 scoped_ptr<storage::FileSystemOperationContext> context, | 168 scoped_ptr<storage::FileSystemOperationContext> context, |
169 const storage::FileSystemURL& url, | 169 const storage::FileSystemURL& url, |
| 170 int /* fields */, |
170 const GetFileInfoCallback& callback) { | 171 const GetFileInfoCallback& callback) { |
171 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 172 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
172 storage::FileSystemOperationContext* context_ptr = context.get(); | 173 storage::FileSystemOperationContext* context_ptr = context.get(); |
173 const bool success = context_ptr->task_runner()->PostTask( | 174 const bool success = context_ptr->task_runner()->PostTask( |
174 FROM_HERE, | 175 FROM_HERE, |
175 base::Bind(&NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread, | 176 base::Bind(&NativeMediaFileUtil::GetFileInfoOnTaskRunnerThread, |
176 weak_factory_.GetWeakPtr(), base::Passed(&context), | 177 weak_factory_.GetWeakPtr(), base::Passed(&context), |
177 url, callback)); | 178 url, callback)); |
178 DCHECK(success); | 179 DCHECK(success); |
179 } | 180 } |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 return base::File::FILE_ERROR_FAILED; | 670 return base::File::FILE_ERROR_FAILED; |
670 | 671 |
671 if (!file_info.is_directory && | 672 if (!file_info.is_directory && |
672 !media_path_filter_->Match(file_path)) { | 673 !media_path_filter_->Match(file_path)) { |
673 return failure_error; | 674 return failure_error; |
674 } | 675 } |
675 | 676 |
676 *local_file_path = file_path; | 677 *local_file_path = file_path; |
677 return base::File::FILE_OK; | 678 return base::File::FILE_OK; |
678 } | 679 } |
OLD | NEW |