skia/ext: Early out from analysis when we have more than 1 draw op.
[chromium-blink-merge.git] / ppapi / native_client / src / trusted / plugin / service_runtime.cc
blob7802af30b1f7aa4711af327b0aa42c72c7ab3311
1 /*
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
4 * found in the LICENSE file.
5 */
7 #define NACL_LOG_MODULE_NAME "Plugin_ServiceRuntime"
9 #include "ppapi/native_client/src/trusted/plugin/service_runtime.h"
11 #include <string.h>
12 #include <set>
13 #include <string>
14 #include <utility>
16 #include "base/compiler_specific.h"
18 #include "native_client/src/include/checked_cast.h"
19 #include "native_client/src/include/portability_io.h"
20 #include "native_client/src/include/portability_string.h"
21 #include "native_client/src/include/nacl_macros.h"
22 #include "native_client/src/include/nacl_scoped_ptr.h"
23 #include "native_client/src/include/nacl_string.h"
24 #include "native_client/src/shared/platform/nacl_check.h"
25 #include "native_client/src/shared/platform/nacl_log.h"
26 #include "native_client/src/shared/platform/nacl_sync.h"
27 #include "native_client/src/shared/platform/nacl_sync_checked.h"
28 #include "native_client/src/shared/platform/nacl_sync_raii.h"
29 #include "native_client/src/shared/platform/scoped_ptr_refcount.h"
30 #include "native_client/src/trusted/desc/nacl_desc_imc.h"
31 // remove when we no longer need to cast the DescWrapper below.
32 #include "native_client/src/trusted/desc/nacl_desc_io.h"
33 #include "native_client/src/trusted/desc/nrd_xfer.h"
34 #include "native_client/src/trusted/nonnacl_util/sel_ldr_launcher.h"
36 #include "native_client/src/public/imc_types.h"
37 #include "native_client/src/public/nacl_file_info.h"
38 #include "native_client/src/trusted/service_runtime/nacl_error_code.h"
40 #include "ppapi/c/pp_errors.h"
41 #include "ppapi/cpp/core.h"
42 #include "ppapi/cpp/completion_callback.h"
44 #include "ppapi/native_client/src/trusted/plugin/plugin.h"
45 #include "ppapi/native_client/src/trusted/plugin/plugin_error.h"
46 #include "ppapi/native_client/src/trusted/plugin/pnacl_resources.h"
47 #include "ppapi/native_client/src/trusted/plugin/sel_ldr_launcher_chrome.h"
48 #include "ppapi/native_client/src/trusted/plugin/srpc_client.h"
49 #include "ppapi/native_client/src/trusted/plugin/utility.h"
50 #include "ppapi/native_client/src/trusted/weak_ref/call_on_main_thread.h"
52 namespace plugin {
54 OpenManifestEntryResource::~OpenManifestEntryResource() {
57 PluginReverseInterface::PluginReverseInterface(
58 nacl::WeakRefAnchor* anchor,
59 PP_Instance pp_instance,
60 ServiceRuntime* service_runtime,
61 pp::CompletionCallback init_done_cb,
62 pp::CompletionCallback crash_cb)
63 : anchor_(anchor),
64 pp_instance_(pp_instance),
65 service_runtime_(service_runtime),
66 shutting_down_(false),
67 init_done_cb_(init_done_cb),
68 crash_cb_(crash_cb) {
69 NaClXMutexCtor(&mu_);
70 NaClXCondVarCtor(&cv_);
73 PluginReverseInterface::~PluginReverseInterface() {
74 NaClCondVarDtor(&cv_);
75 NaClMutexDtor(&mu_);
78 void PluginReverseInterface::ShutDown() {
79 NaClLog(4, "PluginReverseInterface::Shutdown: entered\n");
80 nacl::MutexLocker take(&mu_);
81 shutting_down_ = true;
82 NaClXCondVarBroadcast(&cv_);
83 NaClLog(4, "PluginReverseInterface::Shutdown: broadcasted, exiting\n");
86 void PluginReverseInterface::DoPostMessage(nacl::string message) {
87 std::string full_message = std::string("DEBUG_POSTMESSAGE:") + message;
88 GetNaClInterface()->PostMessageToJavaScript(pp_instance_,
89 full_message.c_str());
92 void PluginReverseInterface::StartupInitializationComplete() {
93 NaClLog(4, "PluginReverseInterface::StartupInitializationComplete\n");
94 if (init_done_cb_.pp_completion_callback().func != NULL) {
95 NaClLog(4,
96 "PluginReverseInterface::StartupInitializationComplete:"
97 " invoking CB\n");
98 pp::Module::Get()->core()->CallOnMainThread(0, init_done_cb_, PP_OK);
99 } else {
100 NaClLog(1,
101 "PluginReverseInterface::StartupInitializationComplete:"
102 " init_done_cb_ not valid, skipping.\n");
106 // TODO(bsy): OpenManifestEntry should use the manifest to ResolveKey
107 // and invoke StreamAsFile with a completion callback that invokes
108 // GetPOSIXFileDesc.
109 bool PluginReverseInterface::OpenManifestEntry(nacl::string url_key,
110 struct NaClFileInfo* info) {
111 bool op_complete = false; // NB: mu_ and cv_ also controls access to this!
112 // The to_open object is owned by the weak ref callback. Because this function
113 // waits for the callback to finish, the to_open object will be deallocated on
114 // the main thread before this function can return. The pointers it contains
115 // to stack variables will not leak.
116 OpenManifestEntryResource* to_open =
117 new OpenManifestEntryResource(url_key, info, &op_complete);
118 CHECK(to_open != NULL);
119 NaClLog(4, "PluginReverseInterface::OpenManifestEntry: %s\n",
120 url_key.c_str());
121 // This assumes we are not on the main thread. If false, we deadlock.
122 plugin::WeakRefCallOnMainThread(
123 anchor_,
125 this,
126 &plugin::PluginReverseInterface::OpenManifestEntry_MainThreadContinuation,
127 to_open);
128 NaClLog(4,
129 "PluginReverseInterface::OpenManifestEntry:"
130 " waiting on main thread\n");
133 nacl::MutexLocker take(&mu_);
134 while (!shutting_down_ && !op_complete)
135 NaClXCondVarWait(&cv_, &mu_);
136 NaClLog(4, "PluginReverseInterface::OpenManifestEntry: done!\n");
137 if (shutting_down_) {
138 NaClLog(4,
139 "PluginReverseInterface::OpenManifestEntry:"
140 " plugin is shutting down\n");
141 return false;
145 // info->desc has the returned descriptor if successful, else -1.
147 // The caller is responsible for not closing info->desc. If it is
148 // closed prematurely, then another open could re-use the OS
149 // descriptor, confusing the opened_ map. If the caller is going to
150 // want to make a NaClDesc object and transfer it etc., then the
151 // caller should DUP the descriptor (but remember the original
152 // value) for use by the NaClDesc object, which closes when the
153 // object is destroyed.
154 NaClLog(4,
155 "PluginReverseInterface::OpenManifestEntry: info->desc = %d\n",
156 info->desc);
157 if (info->desc == -1) {
158 // TODO(bsy,ncbray): what else should we do with the error? This
159 // is a runtime error that may simply be a programming error in
160 // the untrusted code, or it may be something else wrong w/ the
161 // manifest.
162 NaClLog(4, "OpenManifestEntry: failed for key %s", url_key.c_str());
164 return true;
167 // Transfer point from OpenManifestEntry() which runs on the main thread
168 // (Some PPAPI actions -- like StreamAsFile -- can only run on the main thread).
169 // OpenManifestEntry() is waiting on a condvar for this continuation to
170 // complete. We Broadcast and awaken OpenManifestEntry() whenever we are done
171 // either here, or in a later MainThreadContinuation step, if there are
172 // multiple steps.
173 void PluginReverseInterface::OpenManifestEntry_MainThreadContinuation(
174 OpenManifestEntryResource* p,
175 int32_t err) {
176 UNREFERENCED_PARAMETER(err);
177 // CallOnMainThread continuations always called with err == PP_OK.
179 NaClLog(4, "Entered OpenManifestEntry_MainThreadContinuation\n");
181 // Because p is owned by the callback of this invocation, so it is necessary
182 // to create another instance.
183 OpenManifestEntryResource* open_cont = new OpenManifestEntryResource(*p);
184 pp::CompletionCallback stream_cc = WeakRefNewCallback(
185 anchor_,
186 this,
187 &PluginReverseInterface::StreamAsFile_MainThreadContinuation,
188 open_cont);
190 GetNaClInterface()->OpenManifestEntry(
191 pp_instance_,
192 PP_FromBool(!service_runtime_->main_service_runtime()),
193 p->url.c_str(),
194 &open_cont->pp_file_info,
195 stream_cc.pp_completion_callback());
196 // p is deleted automatically.
199 void PluginReverseInterface::StreamAsFile_MainThreadContinuation(
200 OpenManifestEntryResource* p,
201 int32_t result) {
202 NaClLog(4, "Entered StreamAsFile_MainThreadContinuation\n");
204 nacl::MutexLocker take(&mu_);
205 if (result == PP_OK) {
206 // We downloaded this file to temporary storage for this plugin; it's
207 // reasonable to provide a file descriptor with write access.
208 p->file_info->desc = ConvertFileDescriptor(p->pp_file_info.handle, false);
209 p->file_info->file_token.lo = p->pp_file_info.token_lo;
210 p->file_info->file_token.hi = p->pp_file_info.token_hi;
211 NaClLog(4,
212 "StreamAsFile_MainThreadContinuation: PP_OK, desc %d\n",
213 p->file_info->desc);
214 } else {
215 NaClLog(
217 "StreamAsFile_MainThreadContinuation: !PP_OK, setting desc -1\n");
218 p->file_info->desc = -1;
220 *p->op_complete_ptr = true;
221 NaClXCondVarBroadcast(&cv_);
225 void PluginReverseInterface::ReportCrash() {
226 NaClLog(4, "PluginReverseInterface::ReportCrash\n");
228 if (crash_cb_.pp_completion_callback().func != NULL) {
229 NaClLog(4, "PluginReverseInterface::ReportCrash: invoking CB\n");
230 pp::Module::Get()->core()->CallOnMainThread(0, crash_cb_, PP_OK);
231 // Clear the callback to avoid it gets invoked twice.
232 crash_cb_ = pp::CompletionCallback();
233 } else {
234 NaClLog(1,
235 "PluginReverseInterface::ReportCrash:"
236 " crash_cb_ not valid, skipping\n");
240 void PluginReverseInterface::ReportExitStatus(int exit_status) {
241 service_runtime_->set_exit_status(exit_status);
244 int64_t PluginReverseInterface::RequestQuotaForWrite(
245 nacl::string file_id, int64_t offset, int64_t bytes_to_write) {
246 return bytes_to_write;
249 ServiceRuntime::ServiceRuntime(Plugin* plugin,
250 PP_Instance pp_instance,
251 bool main_service_runtime,
252 bool uses_nonsfi_mode,
253 pp::CompletionCallback init_done_cb,
254 pp::CompletionCallback crash_cb)
255 : plugin_(plugin),
256 pp_instance_(pp_instance),
257 main_service_runtime_(main_service_runtime),
258 uses_nonsfi_mode_(uses_nonsfi_mode),
259 reverse_service_(NULL),
260 anchor_(new nacl::WeakRefAnchor()),
261 rev_interface_(new PluginReverseInterface(anchor_, pp_instance, this,
262 init_done_cb, crash_cb)),
263 start_sel_ldr_done_(false),
264 start_nexe_done_(false),
265 nexe_started_ok_(false),
266 bootstrap_channel_(NACL_INVALID_HANDLE) {
267 NaClSrpcChannelInitialize(&command_channel_);
268 NaClXMutexCtor(&mu_);
269 NaClXCondVarCtor(&cond_);
272 bool ServiceRuntime::SetupCommandChannel() {
273 NaClLog(4, "ServiceRuntime::SetupCommand (this=%p, subprocess=%p)\n",
274 static_cast<void*>(this),
275 static_cast<void*>(subprocess_.get()));
276 // Set up the bootstrap channel in our subprocess so that we can establish
277 // SRPC.
278 subprocess_->set_channel(bootstrap_channel_);
280 if (uses_nonsfi_mode_) {
281 // In non-SFI mode, no SRPC is used. Just skips and returns success.
282 return true;
285 if (!subprocess_->SetupCommand(&command_channel_)) {
286 ErrorInfo error_info;
287 error_info.SetReport(PP_NACL_ERROR_SEL_LDR_COMMUNICATION_CMD_CHANNEL,
288 "ServiceRuntime: command channel creation failed");
289 ReportLoadError(error_info);
290 return false;
292 return true;
295 bool ServiceRuntime::InitReverseService() {
296 if (uses_nonsfi_mode_) {
297 // In non-SFI mode, no reverse service is set up. Just returns success.
298 return true;
301 // Hook up the reverse service channel. We are the IMC client, but
302 // provide SRPC service.
303 NaClDesc* out_conn_cap;
304 NaClSrpcResultCodes rpc_result =
305 NaClSrpcInvokeBySignature(&command_channel_,
306 "reverse_setup::h",
307 &out_conn_cap);
309 if (NACL_SRPC_RESULT_OK != rpc_result) {
310 ErrorInfo error_info;
311 error_info.SetReport(PP_NACL_ERROR_SEL_LDR_COMMUNICATION_REV_SETUP,
312 "ServiceRuntime: reverse setup rpc failed");
313 ReportLoadError(error_info);
314 return false;
316 // Get connection capability to service runtime where the IMC
317 // server/SRPC client is waiting for a rendezvous.
318 NaClLog(4, "ServiceRuntime: got 0x%" NACL_PRIxPTR "\n",
319 (uintptr_t) out_conn_cap);
320 nacl::DescWrapper* conn_cap = plugin_->wrapper_factory()->MakeGenericCleanup(
321 out_conn_cap);
322 if (conn_cap == NULL) {
323 ErrorInfo error_info;
324 error_info.SetReport(PP_NACL_ERROR_SEL_LDR_COMMUNICATION_WRAPPER,
325 "ServiceRuntime: wrapper allocation failure");
326 ReportLoadError(error_info);
327 return false;
329 out_conn_cap = NULL; // ownership passed
330 NaClLog(4, "ServiceRuntime::InitReverseService: starting reverse service\n");
331 reverse_service_ = new nacl::ReverseService(conn_cap, rev_interface_->Ref());
332 if (!reverse_service_->Start()) {
333 ErrorInfo error_info;
334 error_info.SetReport(PP_NACL_ERROR_SEL_LDR_COMMUNICATION_REV_SERVICE,
335 "ServiceRuntime: starting reverse services failed");
336 ReportLoadError(error_info);
337 return false;
339 return true;
342 bool ServiceRuntime::StartModule() {
343 // start the module. otherwise we cannot connect for multimedia
344 // subsystem since that is handled by user-level code (not secure!)
345 // in libsrpc.
346 int load_status = -1;
347 if (uses_nonsfi_mode_) {
348 // In non-SFI mode, we don't need to call start_module SRPC to launch
349 // the plugin.
350 load_status = LOAD_OK;
351 } else {
352 NaClSrpcResultCodes rpc_result =
353 NaClSrpcInvokeBySignature(&command_channel_,
354 "start_module::i",
355 &load_status);
357 if (NACL_SRPC_RESULT_OK != rpc_result) {
358 ErrorInfo error_info;
359 error_info.SetReport(PP_NACL_ERROR_SEL_LDR_START_MODULE,
360 "ServiceRuntime: could not start nacl module");
361 ReportLoadError(error_info);
362 return false;
366 NaClLog(4, "ServiceRuntime::StartModule (load_status=%d)\n", load_status);
367 if (main_service_runtime_) {
368 if (load_status < 0 || load_status > NACL_ERROR_CODE_MAX)
369 load_status = LOAD_STATUS_UNKNOWN;
370 GetNaClInterface()->ReportSelLdrStatus(pp_instance_,
371 load_status,
372 NACL_ERROR_CODE_MAX);
375 if (LOAD_OK != load_status) {
376 ErrorInfo error_info;
377 error_info.SetReport(
378 PP_NACL_ERROR_SEL_LDR_START_STATUS,
379 NaClErrorString(static_cast<NaClErrorCode>(load_status)));
380 ReportLoadError(error_info);
381 return false;
383 return true;
386 void ServiceRuntime::StartSelLdr(const SelLdrStartParams& params,
387 pp::CompletionCallback callback) {
388 NaClLog(4, "ServiceRuntime::Start\n");
390 nacl::scoped_ptr<SelLdrLauncherChrome>
391 tmp_subprocess(new SelLdrLauncherChrome());
392 if (NULL == tmp_subprocess.get()) {
393 NaClLog(LOG_ERROR, "ServiceRuntime::Start (subprocess create failed)\n");
394 ErrorInfo error_info;
395 error_info.SetReport(
396 PP_NACL_ERROR_SEL_LDR_CREATE_LAUNCHER,
397 "ServiceRuntime: failed to create sel_ldr launcher");
398 ReportLoadError(error_info);
399 pp::Module::Get()->core()->CallOnMainThread(0, callback, PP_ERROR_FAILED);
400 return;
403 bool enable_dev_interfaces =
404 GetNaClInterface()->DevInterfacesEnabled(pp_instance_);
406 GetNaClInterface()->LaunchSelLdr(
407 pp_instance_,
408 PP_FromBool(main_service_runtime_),
409 params.url.c_str(),
410 &params.file_info,
411 PP_FromBool(params.uses_irt),
412 PP_FromBool(params.uses_ppapi),
413 PP_FromBool(uses_nonsfi_mode_),
414 PP_FromBool(enable_dev_interfaces),
415 PP_FromBool(params.enable_dyncode_syscalls),
416 PP_FromBool(params.enable_exception_handling),
417 PP_FromBool(params.enable_crash_throttling),
418 &bootstrap_channel_,
419 callback.pp_completion_callback());
420 subprocess_.reset(tmp_subprocess.release());
423 bool ServiceRuntime::WaitForSelLdrStart() {
424 // Time to wait on condvar (for browser to create a new sel_ldr process on
425 // our behalf). Use 6 seconds to be *fairly* conservative.
427 // On surfaway, the CallOnMainThread above may never get scheduled
428 // to unblock this condvar, or the IPC reply from the browser to renderer
429 // might get canceled/dropped. However, it is currently important to
430 // avoid waiting indefinitely because ~PnaclCoordinator will attempt to
431 // join() the PnaclTranslateThread, and the PnaclTranslateThread is waiting
432 // for the signal before exiting.
433 static int64_t const kWaitTimeMicrosecs = 6 * NACL_MICROS_PER_UNIT;
434 int64_t left_to_wait = kWaitTimeMicrosecs;
435 int64_t deadline = NaClGetTimeOfDayMicroseconds() + left_to_wait;
436 nacl::MutexLocker take(&mu_);
437 while(!start_sel_ldr_done_ && left_to_wait > 0) {
438 struct nacl_abi_timespec left_timespec;
439 left_timespec.tv_sec = left_to_wait / NACL_MICROS_PER_UNIT;
440 left_timespec.tv_nsec =
441 (left_to_wait % NACL_MICROS_PER_UNIT) * NACL_NANOS_PER_MICRO;
442 NaClXCondVarTimedWaitRelative(&cond_, &mu_, &left_timespec);
443 int64_t now = NaClGetTimeOfDayMicroseconds();
444 left_to_wait = deadline - now;
446 return start_sel_ldr_done_;
449 void ServiceRuntime::SignalStartSelLdrDone() {
450 nacl::MutexLocker take(&mu_);
451 start_sel_ldr_done_ = true;
452 NaClXCondVarSignal(&cond_);
455 bool ServiceRuntime::WaitForNexeStart() {
456 nacl::MutexLocker take(&mu_);
457 while (!start_nexe_done_)
458 NaClXCondVarWait(&cond_, &mu_);
459 return nexe_started_ok_;
462 void ServiceRuntime::SignalNexeStarted(bool ok) {
463 nacl::MutexLocker take(&mu_);
464 start_nexe_done_ = true;
465 nexe_started_ok_ = ok;
466 NaClXCondVarSignal(&cond_);
469 void ServiceRuntime::StartNexe() {
470 bool ok = StartNexeInternal();
471 if (ok) {
472 NaClLog(4, "ServiceRuntime::StartNexe (success)\n");
473 } else {
474 ReapLogs();
476 // This only matters if a background thread is waiting, but we signal in all
477 // cases to simplify the code.
478 SignalNexeStarted(ok);
481 bool ServiceRuntime::StartNexeInternal() {
482 if (!SetupCommandChannel())
483 return false;
484 if (!InitReverseService())
485 return false;
486 return StartModule();
489 void ServiceRuntime::ReapLogs() {
490 // On a load failure the service runtime does not crash itself to
491 // avoid a race where the no-more-senders error on the reverse
492 // channel service thread might cause the crash-detection logic to
493 // kick in before the start_module RPC reply has been received. So
494 // we induce a service runtime crash here. We do not release
495 // subprocess_ since it's needed to collect crash log output after
496 // the error is reported.
497 RemoteLog(LOG_FATAL, "reap logs\n");
498 if (NULL == reverse_service_) {
499 // No crash detector thread.
500 NaClLog(LOG_ERROR, "scheduling to get crash log\n");
501 // Invoking rev_interface's method is workaround to avoid crash_cb
502 // gets called twice or more. We should clean this up later.
503 rev_interface_->ReportCrash();
504 NaClLog(LOG_ERROR, "should fire soon\n");
505 } else {
506 NaClLog(LOG_ERROR, "Reverse service thread will pick up crash log\n");
510 void ServiceRuntime::ReportLoadError(const ErrorInfo& error_info) {
511 if (main_service_runtime_) {
512 plugin_->ReportLoadError(error_info);
516 SrpcClient* ServiceRuntime::SetupAppChannel() {
517 NaClLog(4, "ServiceRuntime::SetupAppChannel (subprocess_=%p)\n",
518 reinterpret_cast<void*>(subprocess_.get()));
519 nacl::DescWrapper* connect_desc = subprocess_->socket_addr()->Connect();
520 if (NULL == connect_desc) {
521 NaClLog(LOG_ERROR, "ServiceRuntime::SetupAppChannel (connect failed)\n");
522 return NULL;
523 } else {
524 NaClLog(4, "ServiceRuntime::SetupAppChannel (conect_desc=%p)\n",
525 static_cast<void*>(connect_desc));
526 SrpcClient* srpc_client = SrpcClient::New(connect_desc);
527 NaClLog(4, "ServiceRuntime::SetupAppChannel (srpc_client=%p)\n",
528 static_cast<void*>(srpc_client));
529 delete connect_desc;
530 return srpc_client;
534 bool ServiceRuntime::RemoteLog(int severity, const nacl::string& msg) {
535 NaClSrpcResultCodes rpc_result =
536 NaClSrpcInvokeBySignature(&command_channel_,
537 "log:is:",
538 severity,
539 strdup(msg.c_str()));
540 return (NACL_SRPC_RESULT_OK == rpc_result);
543 void ServiceRuntime::Shutdown() {
544 rev_interface_->ShutDown();
545 anchor_->Abandon();
546 // Abandon callbacks, tell service threads to quit if they were
547 // blocked waiting for main thread operations to finish. Note that
548 // some callbacks must still await their completion event, e.g.,
549 // CallOnMainThread must still wait for the time out, or I/O events
550 // must finish, so resources associated with pending events cannot
551 // be deallocated.
553 // Note that this does waitpid() to get rid of any zombie subprocess.
554 subprocess_.reset(NULL);
556 NaClSrpcDtor(&command_channel_);
558 // subprocess_ has been shut down, but threads waiting on messages
559 // from the service runtime may not have noticed yet. The low-level
560 // NaClSimpleRevService code takes care to refcount the data objects
561 // that it needs, and reverse_service_ is also refcounted. We wait
562 // for the service threads to get their EOF indications.
563 if (reverse_service_ != NULL) {
564 reverse_service_->WaitForServiceThreadsToExit();
565 reverse_service_->Unref();
566 reverse_service_ = NULL;
570 ServiceRuntime::~ServiceRuntime() {
571 NaClLog(4, "ServiceRuntime::~ServiceRuntime (this=%p)\n",
572 static_cast<void*>(this));
573 // We do this just in case Shutdown() was not called.
574 subprocess_.reset(NULL);
575 if (reverse_service_ != NULL)
576 reverse_service_->Unref();
578 rev_interface_->Unref();
580 anchor_->Unref();
581 NaClCondVarDtor(&cond_);
582 NaClMutexDtor(&mu_);
585 void ServiceRuntime::set_exit_status(int exit_status) {
586 nacl::MutexLocker take(&mu_);
587 if (main_service_runtime_)
588 plugin_->set_exit_status(exit_status & 0xff);
591 nacl::string ServiceRuntime::GetCrashLogOutput() {
592 if (NULL != subprocess_.get()) {
593 return subprocess_->GetCrashLogOutput();
594 } else {
595 return std::string();
599 } // namespace plugin