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

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

Issue 210803003: [fsp] Decouple file_service_provider::Service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 6 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/file_system_provider/fake_provided_file_system .h"
6
7 #include "base/files/file.h"
8 #include "chrome/browser/chromeos/file_system_provider/request_manager.h"
9 #include "chrome/browser/profiles/profile.h"
10
11 namespace chromeos {
12 namespace file_system_provider {
13
14 FakeProvidedFileSystem::FakeProvidedFileSystem() {}
15
16 FakeProvidedFileSystem::FakeProvidedFileSystem(
17 const ProvidedFileSystemInfo& file_system_info)
18 : file_system_info_(file_system_info) {}
19
20 FakeProvidedFileSystem::~FakeProvidedFileSystem() {}
21
22 bool FakeProvidedFileSystem::RequestUnmount(
23 const fileapi::AsyncFileUtil::StatusCallback& callback) {
24 callback.Run(base::File::FILE_OK);
hashimoto 2014/04/14 10:43:42 How about doing something like MessageLoopProxy::c
mtomasz 2014/04/15 02:46:40 Hm. That's an interesting idea. However, calling c
hashimoto 2014/04/15 07:22:45 Calling MessageLoop::Run is discouraged. Please us
mtomasz 2014/04/15 09:42:12 Done.
25 return true;
26 }
27
28 const ProvidedFileSystemInfo& FakeProvidedFileSystem::GetFileSystemInfo()
29 const {
30 return file_system_info_;
31 }
32
33 FakeProvidedFileSystemFactory::FakeProvidedFileSystemFactory() {}
34
35 ProvidedFileSystemInterface* FakeProvidedFileSystemFactory::Create(
36 Profile* profile,
37 RequestManager* request_manager,
38 const ProvidedFileSystemInfo& file_system_info) {
39 DCHECK(profile);
40 DCHECK(request_manager);
41 // TODO(mtomasz): Create a request manager in ProvidedFileSystem, since it is
42 // only used by ProvidedFileSystem, instead of having a profile wide one.
43 // As a result, there will be no need to pass the request manager to
44 // ProvidedFileSystemInterface::Create().
45 return new FakeProvidedFileSystem(file_system_info);
46 }
47
48 } // namespace file_system_provider
49 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698