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

Unified Diff: chrome/browser/chromeos/file_system_provider/request_manager.h

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 side-by-side diff with in-line comments
Download patch
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 a712165964966b45d1171aa17041dd36b34a57fc..4b2d1da445dd984da352ec81dcecf36af36217c1 100644
--- a/chrome/browser/chromeos/file_system_provider/request_manager.h
+++ b/chrome/browser/chromeos/file_system_provider/request_manager.h
@@ -11,7 +11,6 @@
#include "base/callback.h"
#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_info.h"
namespace base {
@@ -27,54 +26,32 @@ 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 {
+class RequestManager {
public:
RequestManager();
virtual ~RequestManager();
// 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 std::string& extension_id,
- int file_system_id,
- const SuccessCallback& success_callback,
+ int CreateRequest(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 std::string& extension_id,
- int file_system_id,
- int request_id,
+ bool FulfillRequest(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 std::string& extension_id,
- int file_system_id,
- int request_id,
- base::File::Error error);
-
- // file_system_provider::Observer overrides.
- virtual void OnProvidedFileSystemMount(
- const ProvidedFileSystemInfo& file_system_info,
- base::File::Error error) OVERRIDE;
- virtual void OnProvidedFileSystemUnmount(
- const ProvidedFileSystemInfo& file_system_info,
- base::File::Error error) OVERRIDE;
+ bool RejectRequest(int request_id, base::File::Error error);
private:
struct Request {
Request();
~Request();
- // 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;

Powered by Google App Engine
This is Rietveld 408576698