| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_SYSTEM_PROVIDER_PROVIDER_FUNCTIO
N_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_SYSTEM_PROVIDER_PROVIDER_FUNCTIO
N_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_SYSTEM_PROVIDER_PROVIDER_FUNCTIO
N_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_SYSTEM_PROVIDER_PROVIDER_FUNCTIO
N_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // Base class for internal API functions handling request results, either | 53 // Base class for internal API functions handling request results, either |
| 54 // a success or a failure. | 54 // a success or a failure. |
| 55 class FileSystemProviderInternalFunction : public ChromeSyncExtensionFunction { | 55 class FileSystemProviderInternalFunction : public ChromeSyncExtensionFunction { |
| 56 public: | 56 public: |
| 57 FileSystemProviderInternalFunction(); | 57 FileSystemProviderInternalFunction(); |
| 58 | 58 |
| 59 protected: | 59 protected: |
| 60 virtual ~FileSystemProviderInternalFunction() {} | 60 virtual ~FileSystemProviderInternalFunction() {} |
| 61 | 61 |
| 62 // Rejects the request and sets a response for this API function. | 62 // Rejects the request and sets a response for this API function. |
| 63 void RejectRequest( | 63 void RejectRequest(base::File::Error error); |
| 64 scoped_ptr<chromeos::file_system_provider::RequestValue> value, | |
| 65 base::File::Error error); | |
| 66 | 64 |
| 67 // Fulfills the request with parsed arguments of this API function | 65 // Fulfills the request with parsed arguments of this API function |
| 68 // encapsulated as a RequestValue instance. Also, sets a response. | 66 // encapsulated as a RequestValue instance. Also, sets a response. |
| 69 // If |has_more| is set to true, then the function will be called again for | 67 // If |has_more| is set to true, then the function will be called again for |
| 70 // this request. | 68 // this request. |
| 71 void FulfillRequest( | 69 void FulfillRequest( |
| 72 scoped_ptr<chromeos::file_system_provider::RequestValue> value, | 70 scoped_ptr<chromeos::file_system_provider::RequestValue> value, |
| 73 bool has_more); | 71 bool has_more); |
| 74 | 72 |
| 75 // Subclasses implement this for their functionality. | 73 // Subclasses implement this for their functionality. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 88 // Sets an error message in case of a failure. | 86 // Sets an error message in case of a failure. |
| 89 void SetErrorResponse(const std::string& name, const std::string& message); | 87 void SetErrorResponse(const std::string& name, const std::string& message); |
| 90 | 88 |
| 91 int request_id_; | 89 int request_id_; |
| 92 chromeos::file_system_provider::RequestManager* request_manager_; | 90 chromeos::file_system_provider::RequestManager* request_manager_; |
| 93 }; | 91 }; |
| 94 | 92 |
| 95 } // namespace extensions | 93 } // namespace extensions |
| 96 | 94 |
| 97 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_SYSTEM_PROVIDER_PROVIDER_FUNC
TION_H_ | 95 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_SYSTEM_PROVIDER_PROVIDER_FUNC
TION_H_ |
| OLD | NEW |