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

Side by Side Diff: ppapi/native_client/src/trusted/plugin/service_runtime.h

Issue 268793002: Pepper: Move DoPostMessage out of trusted plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix threading behavior Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 bool uses_irt; 69 bool uses_irt;
70 bool uses_ppapi; 70 bool uses_ppapi;
71 bool uses_nonsfi_mode; 71 bool uses_nonsfi_mode;
72 bool enable_dev_interfaces; 72 bool enable_dev_interfaces;
73 bool enable_dyncode_syscalls; 73 bool enable_dyncode_syscalls;
74 bool enable_exception_handling; 74 bool enable_exception_handling;
75 bool enable_crash_throttling; 75 bool enable_crash_throttling;
76 }; 76 };
77 77
78 // Callback resources are essentially our continuation state. 78 // Callback resources are essentially our continuation state.
79 struct PostMessageResource {
80 public:
81 explicit PostMessageResource(std::string msg)
82 : message(msg) {}
83 std::string message;
84 };
85
86 struct OpenManifestEntryResource { 79 struct OpenManifestEntryResource {
87 public: 80 public:
88 OpenManifestEntryResource(const std::string& target_url, 81 OpenManifestEntryResource(const std::string& target_url,
89 struct NaClFileInfo* finfo, 82 struct NaClFileInfo* finfo,
90 bool* op_complete, 83 bool* op_complete,
91 OpenManifestEntryAsyncCallback* callback) 84 OpenManifestEntryAsyncCallback* callback)
92 : url(target_url), 85 : url(target_url),
93 file_info(finfo), 86 file_info(finfo),
94 op_complete_ptr(op_complete), 87 op_complete_ptr(op_complete),
95 callback(callback) {} 88 callback(callback) {}
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // This is a sibling of OpenManifestEntry. While OpenManifestEntry is 172 // This is a sibling of OpenManifestEntry. While OpenManifestEntry is
180 // a sync function and must be called on a non-main thread, 173 // a sync function and must be called on a non-main thread,
181 // OpenManifestEntryAsync must be called on the main thread. Upon completion 174 // OpenManifestEntryAsync must be called on the main thread. Upon completion
182 // (even on error), callback will be invoked. The caller has responsibility 175 // (even on error), callback will be invoked. The caller has responsibility
183 // to keep the memory passed to info until callback is invoked. 176 // to keep the memory passed to info until callback is invoked.
184 void OpenManifestEntryAsync(const nacl::string& key, 177 void OpenManifestEntryAsync(const nacl::string& key,
185 struct NaClFileInfo* info, 178 struct NaClFileInfo* info,
186 OpenManifestEntryAsyncCallback* callback); 179 OpenManifestEntryAsyncCallback* callback);
187 180
188 protected: 181 protected:
189 virtual void PostMessage_MainThreadContinuation(PostMessageResource* p,
190 int32_t err);
191
192 virtual void OpenManifestEntry_MainThreadContinuation( 182 virtual void OpenManifestEntry_MainThreadContinuation(
193 OpenManifestEntryResource* p, 183 OpenManifestEntryResource* p,
194 int32_t err); 184 int32_t err);
195 185
196 virtual void StreamAsFile_MainThreadContinuation( 186 virtual void StreamAsFile_MainThreadContinuation(
197 OpenManifestEntryResource* p, 187 OpenManifestEntryResource* p,
198 int32_t result); 188 int32_t result);
199 189
200 virtual void CloseManifestEntry_MainThreadContinuation( 190 virtual void CloseManifestEntry_MainThreadContinuation(
201 CloseManifestEntryResource* cls, 191 CloseManifestEntryResource* cls,
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 int exit_status_; 290 int exit_status_;
301 bool start_sel_ldr_done_; 291 bool start_sel_ldr_done_;
302 292
303 PP_Var start_sel_ldr_error_message_; 293 PP_Var start_sel_ldr_error_message_;
304 pp::CompletionCallbackFactory<ServiceRuntime> callback_factory_; 294 pp::CompletionCallbackFactory<ServiceRuntime> callback_factory_;
305 }; 295 };
306 296
307 } // namespace plugin 297 } // namespace plugin
308 298
309 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SERVICE_RUNTIME_H_ 299 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SERVICE_RUNTIME_H_
OLDNEW
« no previous file with comments | « ppapi/c/private/ppb_nacl_private.h ('k') | ppapi/native_client/src/trusted/plugin/service_runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698