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

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

Issue 235983020: Pepper: Move PnaclOptions outside trusted plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: another build fix Created 6 years, 8 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 /* 1 /*
2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be 3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 #define NACL_LOG_MODULE_NAME "Plugin_ServiceRuntime" 7 #define NACL_LOG_MODULE_NAME "Plugin_ServiceRuntime"
8 8
9 #include "ppapi/native_client/src/trusted/plugin/service_runtime.h" 9 #include "ppapi/native_client/src/trusted/plugin/service_runtime.h"
10 10
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "native_client/src/trusted/service_runtime/nacl_error_code.h" 43 #include "native_client/src/trusted/service_runtime/nacl_error_code.h"
44 #include "native_client/src/trusted/validator/nacl_file_info.h" 44 #include "native_client/src/trusted/validator/nacl_file_info.h"
45 45
46 #include "ppapi/c/pp_errors.h" 46 #include "ppapi/c/pp_errors.h"
47 #include "ppapi/cpp/core.h" 47 #include "ppapi/cpp/core.h"
48 #include "ppapi/cpp/completion_callback.h" 48 #include "ppapi/cpp/completion_callback.h"
49 49
50 #include "ppapi/native_client/src/trusted/plugin/manifest.h" 50 #include "ppapi/native_client/src/trusted/plugin/manifest.h"
51 #include "ppapi/native_client/src/trusted/plugin/plugin.h" 51 #include "ppapi/native_client/src/trusted/plugin/plugin.h"
52 #include "ppapi/native_client/src/trusted/plugin/plugin_error.h" 52 #include "ppapi/native_client/src/trusted/plugin/plugin_error.h"
53 #include "ppapi/native_client/src/trusted/plugin/pnacl_options.h"
54 #include "ppapi/native_client/src/trusted/plugin/pnacl_resources.h" 53 #include "ppapi/native_client/src/trusted/plugin/pnacl_resources.h"
55 #include "ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h" 54 #include "ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h"
56 #include "ppapi/native_client/src/trusted/plugin/srpc_client.h" 55 #include "ppapi/native_client/src/trusted/plugin/srpc_client.h"
57 #include "ppapi/native_client/src/trusted/weak_ref/call_on_main_thread.h" 56 #include "ppapi/native_client/src/trusted/weak_ref/call_on_main_thread.h"
58 57
59 namespace { 58 namespace {
60 59
61 // For doing crude quota enforcement on writes to temp files. 60 // For doing crude quota enforcement on writes to temp files.
62 // We do not allow a temp file bigger than 128 MB for now. 61 // We do not allow a temp file bigger than 128 MB for now.
63 // There is currently a limit of 32M for nexe text size, so 128M 62 // There is currently a limit of 32M for nexe text size, so 128M
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 // multiple steps. 208 // multiple steps.
210 void PluginReverseInterface::OpenManifestEntry_MainThreadContinuation( 209 void PluginReverseInterface::OpenManifestEntry_MainThreadContinuation(
211 OpenManifestEntryResource* p, 210 OpenManifestEntryResource* p,
212 int32_t err) { 211 int32_t err) {
213 UNREFERENCED_PARAMETER(err); 212 UNREFERENCED_PARAMETER(err);
214 // CallOnMainThread continuations always called with err == PP_OK. 213 // CallOnMainThread continuations always called with err == PP_OK.
215 214
216 NaClLog(4, "Entered OpenManifestEntry_MainThreadContinuation\n"); 215 NaClLog(4, "Entered OpenManifestEntry_MainThreadContinuation\n");
217 216
218 std::string mapped_url; 217 std::string mapped_url;
219 PnaclOptions pnacl_options; 218 PP_PNaClOptions pnacl_options;
220 ErrorInfo error_info; 219 ErrorInfo error_info;
221 if (!manifest_->ResolveKey(p->url, &mapped_url, 220 if (!manifest_->ResolveKey(p->url, &mapped_url,
222 &pnacl_options, &error_info)) { 221 &pnacl_options, &error_info)) {
223 NaClLog(4, "OpenManifestEntry_MainThreadContinuation: ResolveKey failed\n"); 222 NaClLog(4, "OpenManifestEntry_MainThreadContinuation: ResolveKey failed\n");
224 NaClLog(4, 223 NaClLog(4,
225 "Error code %d, string %s\n", 224 "Error code %d, string %s\n",
226 error_info.error_code(), 225 error_info.error_code(),
227 error_info.message().c_str()); 226 error_info.message().c_str());
228 // Failed, and error_info has the details on what happened. Wake 227 // Failed, and error_info has the details on what happened. Wake
229 // up requesting thread -- we are done. 228 // up requesting thread -- we are done.
230 nacl::MutexLocker take(&mu_); 229 nacl::MutexLocker take(&mu_);
231 *p->op_complete_ptr = true; // done... 230 *p->op_complete_ptr = true; // done...
232 p->file_info->desc = -1; // but failed. 231 p->file_info->desc = -1; // but failed.
233 NaClXCondVarBroadcast(&cv_); 232 NaClXCondVarBroadcast(&cv_);
234 return; 233 return;
235 } 234 }
236 NaClLog(4, 235 NaClLog(4,
237 "OpenManifestEntry_MainThreadContinuation: " 236 "OpenManifestEntry_MainThreadContinuation: "
238 "ResolveKey: %s -> %s (pnacl_translate(%d))\n", 237 "ResolveKey: %s -> %s (pnacl_translate(%d))\n",
239 p->url.c_str(), mapped_url.c_str(), pnacl_options.translate()); 238 p->url.c_str(), mapped_url.c_str(), pnacl_options.translate);
240 239
241 if (pnacl_options.translate()) { 240 if (pnacl_options.translate) {
242 // Requires PNaCl translation, but that's not supported. 241 // Requires PNaCl translation, but that's not supported.
243 NaClLog(4, 242 NaClLog(4,
244 "OpenManifestEntry_MainThreadContinuation: " 243 "OpenManifestEntry_MainThreadContinuation: "
245 "Requires PNaCl translation -- not supported\n"); 244 "Requires PNaCl translation -- not supported\n");
246 nacl::MutexLocker take(&mu_); 245 nacl::MutexLocker take(&mu_);
247 *p->op_complete_ptr = true; // done... 246 *p->op_complete_ptr = true; // done...
248 p->file_info->desc = -1; // but failed. 247 p->file_info->desc = -1; // but failed.
249 NaClXCondVarBroadcast(&cv_); 248 NaClXCondVarBroadcast(&cv_);
250 return; 249 return;
251 } 250 }
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 754
756 nacl::string ServiceRuntime::GetCrashLogOutput() { 755 nacl::string ServiceRuntime::GetCrashLogOutput() {
757 if (NULL != subprocess_.get()) { 756 if (NULL != subprocess_.get()) {
758 return subprocess_->GetCrashLogOutput(); 757 return subprocess_->GetCrashLogOutput();
759 } else { 758 } else {
760 return std::string(); 759 return std::string();
761 } 760 }
762 } 761 }
763 762
764 } // namespace plugin 763 } // namespace plugin
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698