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

Side by Side Diff: storage/browser/fileapi/local_file_util.cc

Issue 660653006: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | storage/browser/fileapi/native_file_util.cc » ('j') | 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 "storage/browser/fileapi/local_file_util.h" 5 #include "storage/browser/fileapi/local_file_util.h"
6 6
7 #include "base/files/file_enumerator.h" 7 #include "base/files/file_enumerator.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/files/file_util_proxy.h" 9 #include "base/files/file_util_proxy.h"
10 #include "storage/browser/fileapi/async_file_util_adapter.h" 10 #include "storage/browser/fileapi/async_file_util_adapter.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 return error; 132 return error;
133 } 133 }
134 134
135 scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> LocalFileUtil:: 135 scoped_ptr<FileSystemFileUtil::AbstractFileEnumerator> LocalFileUtil::
136 CreateFileEnumerator( 136 CreateFileEnumerator(
137 FileSystemOperationContext* context, 137 FileSystemOperationContext* context,
138 const FileSystemURL& root_url) { 138 const FileSystemURL& root_url) {
139 base::FilePath file_path; 139 base::FilePath file_path;
140 if (GetLocalFilePath(context, root_url, &file_path) != 140 if (GetLocalFilePath(context, root_url, &file_path) !=
141 base::File::FILE_OK) { 141 base::File::FILE_OK) {
142 return make_scoped_ptr(new EmptyFileEnumerator) 142 return make_scoped_ptr(new EmptyFileEnumerator);
143 .PassAs<FileSystemFileUtil::AbstractFileEnumerator>();
144 } 143 }
145 return make_scoped_ptr(new LocalFileEnumerator( 144 return make_scoped_ptr(new LocalFileEnumerator(
146 file_path, root_url.path(), 145 file_path,
147 base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES)) 146 root_url.path(),
148 .PassAs<FileSystemFileUtil::AbstractFileEnumerator>(); 147 base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES));
149 } 148 }
150 149
151 base::File::Error LocalFileUtil::GetLocalFilePath( 150 base::File::Error LocalFileUtil::GetLocalFilePath(
152 FileSystemOperationContext* context, 151 FileSystemOperationContext* context,
153 const FileSystemURL& url, 152 const FileSystemURL& url,
154 base::FilePath* local_file_path) { 153 base::FilePath* local_file_path) {
155 DCHECK(local_file_path); 154 DCHECK(local_file_path);
156 DCHECK(url.is_valid()); 155 DCHECK(url.is_valid());
157 if (url.path().empty()) { 156 if (url.path().empty()) {
158 // Root direcory case, which should not be accessed. 157 // Root direcory case, which should not be accessed.
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 base::FilePath* platform_path) { 255 base::FilePath* platform_path) {
257 DCHECK(file_info); 256 DCHECK(file_info);
258 // We're just returning the local file information. 257 // We're just returning the local file information.
259 *error = GetFileInfo(context, url, file_info, platform_path); 258 *error = GetFileInfo(context, url, file_info, platform_path);
260 if (*error == base::File::FILE_OK && file_info->is_directory) 259 if (*error == base::File::FILE_OK && file_info->is_directory)
261 *error = base::File::FILE_ERROR_NOT_A_FILE; 260 *error = base::File::FILE_ERROR_NOT_A_FILE;
262 return storage::ScopedFile(); 261 return storage::ScopedFile();
263 } 262 }
264 263
265 } // namespace storage 264 } // namespace storage
OLDNEW
« no previous file with comments | « no previous file | storage/browser/fileapi/native_file_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698