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

Side by Side Diff: chrome/browser/chromeos/file_system_provider/fake_provided_file_system.cc

Issue 389893002: [fsp] Add support for creating files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/chromeos/file_system_provider/fake_provided_file_system .h" 5 #include "chrome/browser/chromeos/file_system_provider/fake_provided_file_system .h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/files/file.h" 9 #include "base/files/file.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 } 237 }
238 238
239 void FakeProvidedFileSystem::DeleteEntry( 239 void FakeProvidedFileSystem::DeleteEntry(
240 const base::FilePath& entry_path, 240 const base::FilePath& entry_path,
241 bool recursive, 241 bool recursive,
242 const fileapi::AsyncFileUtil::StatusCallback& callback) { 242 const fileapi::AsyncFileUtil::StatusCallback& callback) {
243 base::MessageLoopProxy::current()->PostTask( 243 base::MessageLoopProxy::current()->PostTask(
244 FROM_HERE, base::Bind(callback, base::File::FILE_OK)); 244 FROM_HERE, base::Bind(callback, base::File::FILE_OK));
245 } 245 }
246 246
247 void FakeProvidedFileSystem::CreateFile(
248 const base::FilePath& file_path,
249 const fileapi::AsyncFileUtil::StatusCallback& callback) {
250 const base::File::Error result = file_path.AsUTF8Unsafe() != kFakeFilePath
251 ? base::File::FILE_ERROR_EXISTS
252 : base::File::FILE_OK;
253
254 base::MessageLoopProxy::current()->PostTask(FROM_HERE,
255 base::Bind(callback, result));
256 }
257
247 const ProvidedFileSystemInfo& FakeProvidedFileSystem::GetFileSystemInfo() 258 const ProvidedFileSystemInfo& FakeProvidedFileSystem::GetFileSystemInfo()
248 const { 259 const {
249 return file_system_info_; 260 return file_system_info_;
250 } 261 }
251 262
252 RequestManager* FakeProvidedFileSystem::GetRequestManager() { 263 RequestManager* FakeProvidedFileSystem::GetRequestManager() {
253 NOTREACHED(); 264 NOTREACHED();
254 return NULL; 265 return NULL;
255 } 266 }
256 267
257 ProvidedFileSystemInterface* FakeProvidedFileSystem::Create( 268 ProvidedFileSystemInterface* FakeProvidedFileSystem::Create(
258 Profile* profile, 269 Profile* profile,
259 const ProvidedFileSystemInfo& file_system_info) { 270 const ProvidedFileSystemInfo& file_system_info) {
260 return new FakeProvidedFileSystem(file_system_info); 271 return new FakeProvidedFileSystem(file_system_info);
261 } 272 }
262 273
263 base::WeakPtr<ProvidedFileSystemInterface> 274 base::WeakPtr<ProvidedFileSystemInterface>
264 FakeProvidedFileSystem::GetWeakPtr() { 275 FakeProvidedFileSystem::GetWeakPtr() {
265 return weak_ptr_factory_.GetWeakPtr(); 276 return weak_ptr_factory_.GetWeakPtr();
266 } 277 }
267 278
268 } // namespace file_system_provider 279 } // namespace file_system_provider
269 } // namespace chromeos 280 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698