| 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 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file.h" | 9 #include "base/files/file.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // this request. | 66 // this request. |
| 67 void FulfillRequest( | 67 void FulfillRequest( |
| 68 scoped_ptr<chromeos::file_system_provider::RequestValue> value, | 68 scoped_ptr<chromeos::file_system_provider::RequestValue> value, |
| 69 bool has_next); | 69 bool has_next); |
| 70 | 70 |
| 71 // Subclasses implement this for their functionality. | 71 // Subclasses implement this for their functionality. |
| 72 // Called after Parse() is successful, such that |request_id_| and | 72 // Called after Parse() is successful, such that |request_id_| and |
| 73 // |request_manager_| have been fully initialized. | 73 // |request_manager_| have been fully initialized. |
| 74 virtual bool RunWhenValid() = 0; | 74 virtual bool RunWhenValid() = 0; |
| 75 | 75 |
| 76 private: | |
| 77 // ChromeSyncExtensionFunction overrides. | 76 // ChromeSyncExtensionFunction overrides. |
| 78 virtual bool RunSync() OVERRIDE; | 77 virtual bool RunSync() OVERRIDE; |
| 79 | 78 |
| 79 private: |
| 80 // Parses the request in order to extract the request manager. If fails, then | 80 // Parses the request in order to extract the request manager. If fails, then |
| 81 // sets a response and returns false. | 81 // sets a response and returns false. |
| 82 bool Parse(); | 82 bool Parse(); |
| 83 | 83 |
| 84 // Sets an error message in case of a failure. | 84 // Sets an error message in case of a failure. |
| 85 void SetErrorResponse(const std::string& name, const std::string& message); | 85 void SetErrorResponse(const std::string& name, const std::string& message); |
| 86 | 86 |
| 87 int request_id_; | 87 int request_id_; |
| 88 chromeos::file_system_provider::RequestManager* request_manager_; | 88 chromeos::file_system_provider::RequestManager* request_manager_; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 } // namespace extensions | 91 } // namespace extensions |
| 92 | 92 |
| 93 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_SYSTEM_PROVIDER_PROVIDER_FUNC
TION_H_ | 93 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_SYSTEM_PROVIDER_PROVIDER_FUNC
TION_H_ |
| OLD | NEW |