Chromium Code Reviews| Index: chrome/browser/chromeos/file_system_provider/request_manager.h |
| diff --git a/chrome/browser/chromeos/file_system_provider/request_manager.h b/chrome/browser/chromeos/file_system_provider/request_manager.h |
| index cf16d4720f7efa01760ae17a2c7f7fb1f832c534..3cc4169b85347ff08559c58a854af631fc0d6bac 100644 |
| --- a/chrome/browser/chromeos/file_system_provider/request_manager.h |
| +++ b/chrome/browser/chromeos/file_system_provider/request_manager.h |
| @@ -12,7 +12,7 @@ |
| #include "base/files/file.h" |
| #include "base/memory/scoped_ptr.h" |
| #include "chrome/browser/chromeos/file_system_provider/observer.h" |
| -#include "chrome/browser/chromeos/file_system_provider/provided_file_system.h" |
| +#include "chrome/browser/chromeos/file_system_provider/provided_file_system_info.h" |
| namespace base { |
| class DictionaryValue; |
| @@ -21,12 +21,13 @@ class DictionaryValue; |
| namespace chromeos { |
| namespace file_system_provider { |
| -typedef base::Callback<void(scoped_ptr<base::DictionaryValue>, bool has_next)> |
| - SuccessCallback; |
| +typedef base::Callback<void(scoped_ptr<base::DictionaryValue> result, |
| + bool has_next)> SuccessCallback; |
| typedef base::Callback<void(base::File::Error)> ErrorCallback; |
| // Manages requests between the service, async utils and the providing |
| // extensions. |
| +// TODO(mtomasz): Create for each provided file system. |
| class RequestManager : public Observer { |
| public: |
| RequestManager(); |
| @@ -34,35 +35,42 @@ class RequestManager : public Observer { |
| // Creates a request and returns its request id (greater than 0). Returns 0 in |
| // case of an error (eg. too many requests). The passed callbacks can be NULL. |
| - int CreateRequest(const ProvidedFileSystem& file_system, |
| + int CreateRequest(const std::string extension_id, |
|
hashimoto
2014/03/26 03:03:01
nit: const std::string&
mtomasz
2014/03/26 05:45:13
Oops. Done.
|
| + int file_system_id, |
| const SuccessCallback& success_callback, |
| const ErrorCallback& error_callback); |
| // Handles successful response for the |request_id|. If |has_next| is false, |
| // then the request is disposed, after handling the |response|. On error, |
| // returns false, and the request is disposed. |
| - bool FulfillRequest(const ProvidedFileSystem& file_system, |
| + bool FulfillRequest(const std::string& extension_id, |
| + int file_system_id, |
| int request_id, |
| scoped_ptr<base::DictionaryValue> response, |
| bool has_next); |
| // Handles error response for the |request_id|. If handling the error fails, |
| // returns false. Always disposes the request. |
| - bool RejectRequest(const ProvidedFileSystem& file_system, |
| + bool RejectRequest(const std::string& extension_id, |
| + int file_system_id, |
| int request_id, |
| base::File::Error error); |
| // file_system_provider::Observer overrides. |
| - virtual void OnProvidedFileSystemMount(const ProvidedFileSystem& file_system, |
| - base::File::Error error) OVERRIDE; |
| + virtual void OnProvidedFileSystemMount( |
| + const ProvidedFileSystemInfo& file_system_info, |
|
hashimoto
2014/03/26 03:03:01
Why don't these methods take (extension_id, file_s
mtomasz
2014/03/26 05:45:13
Just to match the observer's interface.
As for Cr
hashimoto
2014/03/26 06:53:04
Thank you for clearly explaining about your plan.
|
| + base::File::Error error) OVERRIDE; |
| virtual void OnProvidedFileSystemUnmount( |
| - const ProvidedFileSystem& file_system, |
| + const ProvidedFileSystemInfo& file_system_info, |
| base::File::Error error) OVERRIDE; |
| private: |
| struct Request { |
| - // Provided file system handling the request. |
| - ProvidedFileSystem file_system; |
| + // Providing extension's ID. |
| + std::string extension_id; |
| + |
| + // Provided file system's ID. |
| + int file_system_id; |
| // Callback to be called on success. |
| SuccessCallback success_callback; |