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

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

Issue 239993002: [fsp] Create a RequestManager per a ProvidedFileSystem instance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed and 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
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 "base/files/file.h" 7 #include "base/files/file.h"
8 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/message_loop/message_loop_proxy.h"
9 #include "chrome/browser/chromeos/file_system_provider/request_manager.h"
10 #include "extensions/browser/event_router.h" 9 #include "extensions/browser/event_router.h"
11 10
12 namespace chromeos { 11 namespace chromeos {
13 namespace file_system_provider { 12 namespace file_system_provider {
14 13
15 FakeProvidedFileSystem::FakeProvidedFileSystem( 14 FakeProvidedFileSystem::FakeProvidedFileSystem(
16 const ProvidedFileSystemInfo& file_system_info) 15 const ProvidedFileSystemInfo& file_system_info)
17 : file_system_info_(file_system_info) {} 16 : file_system_info_(file_system_info) {}
18 17
19 FakeProvidedFileSystem::~FakeProvidedFileSystem() {} 18 FakeProvidedFileSystem::~FakeProvidedFileSystem() {}
20 19
21 bool FakeProvidedFileSystem::RequestUnmount( 20 bool FakeProvidedFileSystem::RequestUnmount(
22 const fileapi::AsyncFileUtil::StatusCallback& callback) { 21 const fileapi::AsyncFileUtil::StatusCallback& callback) {
23 base::MessageLoopProxy::current()->PostTask( 22 base::MessageLoopProxy::current()->PostTask(
24 FROM_HERE, base::Bind(callback, base::File::FILE_OK)); 23 FROM_HERE, base::Bind(callback, base::File::FILE_OK));
25 return true; 24 return true;
26 } 25 }
27 26
28 const ProvidedFileSystemInfo& FakeProvidedFileSystem::GetFileSystemInfo() 27 const ProvidedFileSystemInfo& FakeProvidedFileSystem::GetFileSystemInfo()
29 const { 28 const {
30 return file_system_info_; 29 return file_system_info_;
31 } 30 }
32 31
32 RequestManager* FakeProvidedFileSystem::GetRequestManager() {
33 NOTREACHED();
34 return NULL;
35 }
36
33 ProvidedFileSystemInterface* FakeProvidedFileSystem::Create( 37 ProvidedFileSystemInterface* FakeProvidedFileSystem::Create(
34 extensions::EventRouter* event_router, 38 extensions::EventRouter* event_router,
35 RequestManager* request_manager,
36 const ProvidedFileSystemInfo& file_system_info) { 39 const ProvidedFileSystemInfo& file_system_info) {
37 // TODO(mtomasz): Create a request manager in ProvidedFileSystem, since it is
38 // only used by ProvidedFileSystem, instead of having a profile wide one.
39 // As a result, there will be no need to pass the request manager to the
40 // factory callback.
41 return new FakeProvidedFileSystem(file_system_info); 40 return new FakeProvidedFileSystem(file_system_info);
42 } 41 }
43 42
44 } // namespace file_system_provider 43 } // namespace file_system_provider
45 } // namespace chromeos 44 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698