OLD | NEW |
---|---|
1 /* -*- c++ -*- */ | 1 /* -*- c++ -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 * Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 // A class containing information regarding a socket connection to a | 8 // A class containing information regarding a socket connection to a |
9 // service runtime instance. | 9 // service runtime instance. |
10 | 10 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 }; | 76 }; |
77 | 77 |
78 // Callback resources are essentially our continuation state. | 78 // Callback resources are essentially our continuation state. |
79 struct PostMessageResource { | 79 struct PostMessageResource { |
80 public: | 80 public: |
81 explicit PostMessageResource(std::string msg) | 81 explicit PostMessageResource(std::string msg) |
82 : message(msg) {} | 82 : message(msg) {} |
83 std::string message; | 83 std::string message; |
84 }; | 84 }; |
85 | 85 |
86 class OpenManifestEntryAsyncCallback; | |
Mark Seaborn
2014/04/30 21:20:58
Shouldn't forward decls be grouped together near t
hidehiko
2014/05/01 05:20:31
Done.
| |
87 | |
86 struct OpenManifestEntryResource { | 88 struct OpenManifestEntryResource { |
87 public: | 89 public: |
88 OpenManifestEntryResource(const std::string& target_url, | 90 OpenManifestEntryResource(const std::string& target_url, |
89 struct NaClFileInfo* finfo, | 91 struct NaClFileInfo* finfo, |
90 bool* op_complete) | 92 bool* op_complete, |
93 OpenManifestEntryAsyncCallback* callback) | |
91 : url(target_url), | 94 : url(target_url), |
92 file_info(finfo), | 95 file_info(finfo), |
93 op_complete_ptr(op_complete) {} | 96 op_complete_ptr(op_complete), |
97 callback(callback) {} | |
98 ~OpenManifestEntryResource(); | |
99 void MaybeRunCallback(int32_t pp_error); | |
100 | |
94 std::string url; | 101 std::string url; |
95 struct NaClFileInfo* file_info; | 102 struct NaClFileInfo* file_info; |
96 bool* op_complete_ptr; | 103 bool* op_complete_ptr; |
104 OpenManifestEntryAsyncCallback* callback; | |
97 }; | 105 }; |
98 | 106 |
99 struct CloseManifestEntryResource { | 107 struct CloseManifestEntryResource { |
100 public: | 108 public: |
101 CloseManifestEntryResource(int32_t desc_to_close, | 109 CloseManifestEntryResource(int32_t desc_to_close, |
102 bool* op_complete, | 110 bool* op_complete, |
103 bool* op_result) | 111 bool* op_result) |
104 : desc(desc_to_close), | 112 : desc(desc_to_close), |
105 op_complete_ptr(op_complete), | 113 op_complete_ptr(op_complete), |
106 op_result_ptr(op_result) {} | 114 op_result_ptr(op_result) {} |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 virtual void ReportExitStatus(int exit_status); | 171 virtual void ReportExitStatus(int exit_status); |
164 | 172 |
165 virtual int64_t RequestQuotaForWrite(nacl::string file_id, | 173 virtual int64_t RequestQuotaForWrite(nacl::string file_id, |
166 int64_t offset, | 174 int64_t offset, |
167 int64_t bytes_to_write); | 175 int64_t bytes_to_write); |
168 | 176 |
169 void AddQuotaManagedFile(const nacl::string& file_id, | 177 void AddQuotaManagedFile(const nacl::string& file_id, |
170 const pp::FileIO& file_io); | 178 const pp::FileIO& file_io); |
171 void AddTempQuotaManagedFile(const nacl::string& file_id); | 179 void AddTempQuotaManagedFile(const nacl::string& file_id); |
172 | 180 |
181 // This is a sibling of OpenManifestEntry. While OpenManifestEntry is | |
182 // sync function and must be called on a non-main thread, this must be | |
Mark Seaborn
2014/04/30 21:20:58
Nit: "a sync function"? "this" -> "OpenManifestEn
hidehiko
2014/05/01 05:20:31
Done.
| |
183 // called on the main thread. Upon completion (even on error), callback will | |
184 // be invoked. The caller has responsibility to keep the memory passed to | |
185 // info until callback is invoked. | |
186 void OpenManifestEntryAsync(const nacl::string& key, | |
187 struct NaClFileInfo* info, | |
188 OpenManifestEntryAsyncCallback* callback); | |
189 | |
173 protected: | 190 protected: |
174 virtual void PostMessage_MainThreadContinuation(PostMessageResource* p, | 191 virtual void PostMessage_MainThreadContinuation(PostMessageResource* p, |
175 int32_t err); | 192 int32_t err); |
176 | 193 |
177 virtual void OpenManifestEntry_MainThreadContinuation( | 194 virtual void OpenManifestEntry_MainThreadContinuation( |
178 OpenManifestEntryResource* p, | 195 OpenManifestEntryResource* p, |
179 int32_t err); | 196 int32_t err); |
180 | 197 |
181 virtual void StreamAsFile_MainThreadContinuation( | 198 virtual void StreamAsFile_MainThreadContinuation( |
182 OpenManifestEntryResource* p, | 199 OpenManifestEntryResource* p, |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
285 int exit_status_; | 302 int exit_status_; |
286 bool start_sel_ldr_done_; | 303 bool start_sel_ldr_done_; |
287 | 304 |
288 PP_Var start_sel_ldr_error_message_; | 305 PP_Var start_sel_ldr_error_message_; |
289 pp::CompletionCallbackFactory<ServiceRuntime> callback_factory_; | 306 pp::CompletionCallbackFactory<ServiceRuntime> callback_factory_; |
290 }; | 307 }; |
291 | 308 |
292 } // namespace plugin | 309 } // namespace plugin |
293 | 310 |
294 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SERVICE_RUNTIME_H_ | 311 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SERVICE_RUNTIME_H_ |
OLD | NEW |