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

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

Issue 264943003: Pepper: Move manifest logic to components/nacl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased 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 22 matching lines...) Expand all
33 class DescWrapper; 33 class DescWrapper;
34 } // namespace 34 } // namespace
35 35
36 namespace pp { 36 namespace pp {
37 class FileIO; 37 class FileIO;
38 } // namespace 38 } // namespace
39 39
40 namespace plugin { 40 namespace plugin {
41 41
42 class ErrorInfo; 42 class ErrorInfo;
43 class Manifest;
44 class Plugin; 43 class Plugin;
45 class SrpcClient; 44 class SrpcClient;
46 class ServiceRuntime; 45 class ServiceRuntime;
47 46
48 // Struct of params used by StartSelLdr. Use a struct so that callback 47 // Struct of params used by StartSelLdr. Use a struct so that callback
49 // creation templates aren't overwhelmed with too many parameters. 48 // creation templates aren't overwhelmed with too many parameters.
50 struct SelLdrStartParams { 49 struct SelLdrStartParams {
51 SelLdrStartParams(const nacl::string& url, 50 SelLdrStartParams(const nacl::string& url,
52 bool uses_irt, 51 bool uses_irt,
53 bool uses_ppapi, 52 bool uses_ppapi,
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 // Do not invoke from the main thread, since the main methods will 132 // Do not invoke from the main thread, since the main methods will
134 // invoke CallOnMainThread and then wait on a condvar for the task to 133 // invoke CallOnMainThread and then wait on a condvar for the task to
135 // complete: if invoked from the main thread, the main method not 134 // complete: if invoked from the main thread, the main method not
136 // returning (and thus unblocking the main thread) means that the 135 // returning (and thus unblocking the main thread) means that the
137 // main-thread continuation methods will never get called, and thus 136 // main-thread continuation methods will never get called, and thus
138 // we'd get a deadlock. 137 // we'd get a deadlock.
139 class PluginReverseInterface: public nacl::ReverseInterface { 138 class PluginReverseInterface: public nacl::ReverseInterface {
140 public: 139 public:
141 PluginReverseInterface(nacl::WeakRefAnchor* anchor, 140 PluginReverseInterface(nacl::WeakRefAnchor* anchor,
142 Plugin* plugin, 141 Plugin* plugin,
143 const Manifest* manifest, 142 int32_t manifest_id,
144 ServiceRuntime* service_runtime, 143 ServiceRuntime* service_runtime,
145 pp::CompletionCallback init_done_cb, 144 pp::CompletionCallback init_done_cb,
146 pp::CompletionCallback crash_cb); 145 pp::CompletionCallback crash_cb);
147 146
148 virtual ~PluginReverseInterface(); 147 virtual ~PluginReverseInterface();
149 148
150 void ShutDown(); 149 void ShutDown();
151 150
152 virtual void DoPostMessage(nacl::string message); 151 virtual void DoPostMessage(nacl::string message);
153 152
(...skipping 29 matching lines...) Expand all
183 int32_t result); 182 int32_t result);
184 183
185 virtual void CloseManifestEntry_MainThreadContinuation( 184 virtual void CloseManifestEntry_MainThreadContinuation(
186 CloseManifestEntryResource* cls, 185 CloseManifestEntryResource* cls,
187 int32_t err); 186 int32_t err);
188 187
189 private: 188 private:
190 nacl::WeakRefAnchor* anchor_; // holds a ref 189 nacl::WeakRefAnchor* anchor_; // holds a ref
191 Plugin* plugin_; // value may be copied, but should be used only in 190 Plugin* plugin_; // value may be copied, but should be used only in
192 // main thread in WeakRef-protected callbacks. 191 // main thread in WeakRef-protected callbacks.
193 const Manifest* manifest_; 192 int32_t manifest_id_;
194 ServiceRuntime* service_runtime_; 193 ServiceRuntime* service_runtime_;
195 NaClMutex mu_; 194 NaClMutex mu_;
196 NaClCondVar cv_; 195 NaClCondVar cv_;
197 std::set<int64_t> quota_files_; 196 std::set<int64_t> quota_files_;
198 bool shutting_down_; 197 bool shutting_down_;
199 198
200 pp::CompletionCallback init_done_cb_; 199 pp::CompletionCallback init_done_cb_;
201 pp::CompletionCallback crash_cb_; 200 pp::CompletionCallback crash_cb_;
202 }; 201 };
203 202
204 // ServiceRuntime abstracts a NativeClient sel_ldr instance. 203 // ServiceRuntime abstracts a NativeClient sel_ldr instance.
205 class ServiceRuntime { 204 class ServiceRuntime {
206 public: 205 public:
207 // TODO(sehr): This class should also implement factory methods, using the 206 // TODO(sehr): This class should also implement factory methods, using the
208 // Start method below. 207 // Start method below.
209 ServiceRuntime(Plugin* plugin, 208 ServiceRuntime(Plugin* plugin,
210 const Manifest* manifest, 209 int32_t manifest_id,
211 bool main_service_runtime, 210 bool main_service_runtime,
212 bool uses_nonsfi_mode, 211 bool uses_nonsfi_mode,
213 pp::CompletionCallback init_done_cb, 212 pp::CompletionCallback init_done_cb,
214 pp::CompletionCallback crash_cb); 213 pp::CompletionCallback crash_cb);
215 // The destructor terminates the sel_ldr process. 214 // The destructor terminates the sel_ldr process.
216 ~ServiceRuntime(); 215 ~ServiceRuntime();
217 216
218 // Spawn the sel_ldr instance. 217 // Spawn the sel_ldr instance.
219 void StartSelLdr(const SelLdrStartParams& params, 218 void StartSelLdr(const SelLdrStartParams& params,
220 pp::CompletionCallback callback); 219 pp::CompletionCallback callback);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 int exit_status_; 284 int exit_status_;
286 bool start_sel_ldr_done_; 285 bool start_sel_ldr_done_;
287 286
288 PP_Var start_sel_ldr_error_message_; 287 PP_Var start_sel_ldr_error_message_;
289 pp::CompletionCallbackFactory<ServiceRuntime> callback_factory_; 288 pp::CompletionCallbackFactory<ServiceRuntime> callback_factory_;
290 }; 289 };
291 290
292 } // namespace plugin 291 } // namespace plugin
293 292
294 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SERVICE_RUNTIME_H_ 293 #endif // NATIVE_CLIENT_SRC_TRUSTED_PLUGIN_SERVICE_RUNTIME_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698