OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h" | 5 #include "ppapi/native_client/src/trusted/plugin/pnacl_coordinator.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "native_client/src/include/checked_cast.h" | 10 #include "native_client/src/include/checked_cast.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
56 uma.HistogramEnumeration("NaCl.Perf.PNaClCache.IsHit", | 56 uma.HistogramEnumeration("NaCl.Perf.PNaClCache.IsHit", |
57 hit, 2); | 57 hit, 2); |
58 } | 58 } |
59 | 59 |
60 nacl::string GetArchitectureAttributes(Plugin* plugin) { | 60 nacl::string GetArchitectureAttributes(Plugin* plugin) { |
61 pp::Var attrs_var(pp::PASS_REF, | 61 pp::Var attrs_var(pp::PASS_REF, |
62 plugin->nacl_interface()->GetCpuFeatureAttrs()); | 62 plugin->nacl_interface()->GetCpuFeatureAttrs()); |
63 return attrs_var.AsString(); | 63 return attrs_var.AsString(); |
64 } | 64 } |
65 | 65 |
66 void DidCacheHit(void* user_data, PP_FileHandle nexe_file_handle) { | |
67 PnaclCoordinator* coordinator = static_cast<PnaclCoordinator*>(user_data); | |
68 coordinator->BitcodeStreamCacheHit(nexe_file_handle); | |
69 } | |
70 | |
71 void DidCacheMiss(void* user_data, int64_t expected_pexe_size) { | |
72 PnaclCoordinator* coordinator = static_cast<PnaclCoordinator*>(user_data); | |
73 coordinator->BitcodeStreamCacheMiss(expected_pexe_size); | |
74 // Do some fixup for temp_nexe_file_ here. | |
dmichael (off chromium)
2014/07/17 16:13:21
I don't understand this comment; was there somethi
teravest
2014/07/21 18:33:21
Removed.
| |
75 } | |
76 | |
77 void DidStreamData(void* user_data, const void* stream_data, int32_t length) { | |
78 PnaclCoordinator* coordinator = static_cast<PnaclCoordinator*>(user_data); | |
79 coordinator->BitcodeStreamGotData(stream_data, length); | |
80 } | |
81 | |
82 void DidFinishStream(void* user_data, int32_t pp_error) { | |
83 PnaclCoordinator* coordinator = static_cast<PnaclCoordinator*>(user_data); | |
84 coordinator->BitcodeStreamDidFinish(pp_error); | |
85 if (pp_error != PP_OK) { | |
86 | |
dmichael (off chromium)
2014/07/17 16:13:21
Is this obsolete? You're presumably handling this
teravest
2014/07/21 18:33:21
Yes, removed.
| |
87 } | |
88 } | |
89 | |
90 PPP_PexeStreamHandler kPexeStreamHandler = { | |
91 &DidCacheHit, | |
92 &DidCacheMiss, | |
93 &DidStreamData, | |
94 &DidFinishStream | |
95 }; | |
96 | |
66 } // namespace | 97 } // namespace |
67 | 98 |
68 // Out-of-line destructor to keep it from getting put in every .o where | |
69 // callback_source.h is included | |
70 template<> | |
71 CallbackSource<FileStreamData>::~CallbackSource() {} | |
72 | |
73 PnaclCoordinator* PnaclCoordinator::BitcodeToNative( | 99 PnaclCoordinator* PnaclCoordinator::BitcodeToNative( |
74 Plugin* plugin, | 100 Plugin* plugin, |
75 const nacl::string& pexe_url, | 101 const nacl::string& pexe_url, |
76 const PP_PNaClOptions& pnacl_options, | 102 const PP_PNaClOptions& pnacl_options, |
77 const pp::CompletionCallback& translate_notify_callback) { | 103 const pp::CompletionCallback& translate_notify_callback) { |
78 PLUGIN_PRINTF(("PnaclCoordinator::BitcodeToNative (plugin=%p, pexe=%s)\n", | 104 PLUGIN_PRINTF(("PnaclCoordinator::BitcodeToNative (plugin=%p, pexe=%s)\n", |
79 static_cast<void*>(plugin), pexe_url.c_str())); | 105 static_cast<void*>(plugin), pexe_url.c_str())); |
80 PnaclCoordinator* coordinator = | 106 PnaclCoordinator* coordinator = |
81 new PnaclCoordinator(plugin, pexe_url, | 107 new PnaclCoordinator(plugin, pexe_url, |
82 pnacl_options, | 108 pnacl_options, |
(...skipping 17 matching lines...) Expand all Loading... | |
100 const PP_PNaClOptions& pnacl_options, | 126 const PP_PNaClOptions& pnacl_options, |
101 const pp::CompletionCallback& translate_notify_callback) | 127 const pp::CompletionCallback& translate_notify_callback) |
102 : translate_finish_error_(PP_OK), | 128 : translate_finish_error_(PP_OK), |
103 plugin_(plugin), | 129 plugin_(plugin), |
104 translate_notify_callback_(translate_notify_callback), | 130 translate_notify_callback_(translate_notify_callback), |
105 translation_finished_reported_(false), | 131 translation_finished_reported_(false), |
106 pexe_url_(pexe_url), | 132 pexe_url_(pexe_url), |
107 pnacl_options_(pnacl_options), | 133 pnacl_options_(pnacl_options), |
108 architecture_attributes_(GetArchitectureAttributes(plugin)), | 134 architecture_attributes_(GetArchitectureAttributes(plugin)), |
109 split_module_count_(1), | 135 split_module_count_(1), |
110 is_cache_hit_(PP_FALSE), | |
111 error_already_reported_(false), | 136 error_already_reported_(false), |
112 pexe_size_(0), | 137 pexe_size_(0), |
113 pexe_bytes_compiled_(0), | 138 pexe_bytes_compiled_(0), |
114 expected_pexe_size_(-1) { | 139 expected_pexe_size_(-1) { |
115 PLUGIN_PRINTF(("PnaclCoordinator::PnaclCoordinator (this=%p, plugin=%p)\n", | 140 PLUGIN_PRINTF(("PnaclCoordinator::PnaclCoordinator (this=%p, plugin=%p)\n", |
116 static_cast<void*>(this), static_cast<void*>(plugin))); | 141 static_cast<void*>(this), static_cast<void*>(plugin))); |
117 callback_factory_.Initialize(this); | 142 callback_factory_.Initialize(this); |
118 } | 143 } |
119 | 144 |
120 PnaclCoordinator::~PnaclCoordinator() { | 145 PnaclCoordinator::~PnaclCoordinator() { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
258 ReportPpapiError(PP_NACL_ERROR_PNACL_CACHE_FETCH_OTHER, | 283 ReportPpapiError(PP_NACL_ERROR_PNACL_CACHE_FETCH_OTHER, |
259 pp_error, | 284 pp_error, |
260 "Failed to open translated nexe."); | 285 "Failed to open translated nexe."); |
261 return; | 286 return; |
262 } | 287 } |
263 | 288 |
264 translate_notify_callback_.Run(pp_error); | 289 translate_notify_callback_.Run(pp_error); |
265 } | 290 } |
266 | 291 |
267 void PnaclCoordinator::OpenBitcodeStream() { | 292 void PnaclCoordinator::OpenBitcodeStream() { |
268 // Now open the pexe stream. | |
269 streaming_downloader_.reset(new FileDownloader(plugin_)); | |
270 // Mark the request as requesting a PNaCl bitcode file, | |
271 // so that component updater can detect this user action. | |
272 streaming_downloader_->set_request_headers( | |
273 "Accept: application/x-pnacl, */*"); | |
274 | |
275 // Even though we haven't started downloading, create the translation | |
276 // thread object immediately. This ensures that any pieces of the file | |
277 // that get downloaded before the compilation thread is accepting | |
278 // SRPCs won't get dropped. | |
279 translate_thread_.reset(new PnaclTranslateThread()); | |
280 if (translate_thread_ == NULL) { | |
281 ReportNonPpapiError( | |
282 PP_NACL_ERROR_PNACL_THREAD_CREATE, | |
283 "PnaclCoordinator: could not allocate translation thread."); | |
284 return; | |
285 } | |
286 | |
287 pp::CompletionCallback cb = | |
288 callback_factory_.NewCallback(&PnaclCoordinator::BitcodeStreamDidOpen); | |
289 if (!streaming_downloader_->OpenStream(pexe_url_, cb, this)) { | |
290 ReportNonPpapiError( | |
291 PP_NACL_ERROR_PNACL_PEXE_FETCH_OTHER, | |
292 nacl::string("PnaclCoordinator: failed to open stream ") + pexe_url_); | |
293 return; | |
294 } | |
295 } | |
296 | |
297 void PnaclCoordinator::BitcodeStreamDidOpen(int32_t pp_error) { | |
298 if (pp_error != PP_OK) { | |
299 BitcodeStreamDidFinish(pp_error); | |
300 // We have not spun up the translation process yet, so we need to call | |
301 // TranslateFinished here. | |
302 TranslateFinished(pp_error); | |
303 return; | |
304 } | |
305 | |
306 // The component updater's resource throttles + OnDemand update/install | 293 // The component updater's resource throttles + OnDemand update/install |
307 // should block the URL request until the compiler is present. Now we | 294 // should block the URL request until the compiler is present. Now we |
308 // can load the resources (e.g. llc and ld nexes). | 295 // can load the resources (e.g. llc and ld nexes). |
309 resources_.reset(new PnaclResources(plugin_)); | 296 resources_.reset(new PnaclResources(plugin_)); |
310 CHECK(resources_ != NULL); | 297 CHECK(resources_ != NULL); |
dmichael (off chromium)
2014/07/17 16:13:21
I'm a little confused by this. Are you sure your c
teravest
2014/07/21 18:33:21
What are you confused about here? This shouldn't c
dmichael (off chromium)
2014/07/21 19:49:22
Sorry, I was worried that somehow the PnaclTransla
| |
311 | 298 |
312 // The first step of loading resources: read the resource info file. | 299 // The first step of loading resources: read the resource info file. |
313 if (!resources_->ReadResourceInfo()) { | 300 if (!resources_->ReadResourceInfo()) { |
314 ExitWithError(); | 301 ExitWithError(); |
315 return; | 302 return; |
316 } | 303 } |
317 | 304 |
318 // Second step of loading resources: call StartLoad to load pnacl-llc | 305 // Second step of loading resources: call StartLoad to load pnacl-llc |
319 // and pnacl-ld, based on the filenames found in the resource info file. | 306 // and pnacl-ld, based on the filenames found in the resource info file. |
320 if (!resources_->StartLoad()) { | 307 if (!resources_->StartLoad()) { |
321 ReportNonPpapiError( | 308 ReportNonPpapiError( |
322 PP_NACL_ERROR_PNACL_RESOURCE_FETCH, | 309 PP_NACL_ERROR_PNACL_RESOURCE_FETCH, |
323 nacl::string("The Portable Native Client (pnacl) component is not " | 310 nacl::string("The Portable Native Client (pnacl) component is not " |
324 "installed. Please consult chrome://components for more " | 311 "installed. Please consult chrome://components for more " |
325 "information.")); | 312 "information.")); |
326 return; | 313 return; |
327 } | 314 } |
328 | 315 |
329 // Okay, now that we've started the HTTP request for the pexe | 316 // Even though we haven't started downloading, create the translation |
330 // and we've ensured that the PNaCl compiler + metadata is installed, | 317 // thread object immediately. This ensures that any pieces of the file |
331 // get the cache key from the response headers and from the | 318 // that get downloaded before the compilation thread is accepting |
332 // compiler's version metadata. | 319 // SRPCs won't get dropped. |
333 nacl::string headers = streaming_downloader_->GetResponseHeaders(); | 320 translate_thread_.reset(new PnaclTranslateThread()); |
321 if (translate_thread_ == NULL) { | |
322 ReportNonPpapiError( | |
323 PP_NACL_ERROR_PNACL_THREAD_CREATE, | |
324 "PnaclCoordinator: could not allocate translation thread."); | |
325 return; | |
326 } | |
334 | 327 |
335 temp_nexe_file_.reset(new TempFile(plugin_)); | 328 GetNaClInterface()->StreamPexe(plugin_->pp_instance(), |
336 pp::CompletionCallback cb = | 329 pexe_url_.c_str(), |
337 callback_factory_.NewCallback(&PnaclCoordinator::NexeFdDidOpen); | 330 pnacl_options_.opt_level, |
338 int32_t nexe_fd_err = | 331 &kPexeStreamHandler, |
339 plugin_->nacl_interface()->GetNexeFd( | 332 this); |
340 plugin_->pp_instance(), | 333 } |
341 streaming_downloader_->full_url().c_str(), | 334 |
342 // TODO(dschuff): Get this value from the pnacl json file after it | 335 void PnaclCoordinator::BitcodeStreamCacheHit(PP_FileHandle handle) { |
343 // rolls in from NaCl. | 336 HistogramEnumerateTranslationCache(plugin_->uma_interface(), true); |
344 1, | 337 if (handle == PP_kInvalidFileHandle) { |
345 pnacl_options_.opt_level, | 338 ReportNonPpapiError( |
346 headers.c_str(), | 339 PP_NACL_ERROR_PNACL_CREATE_TEMP, |
347 architecture_attributes_.c_str(), // Extra compile flags. | 340 nacl::string( |
348 &is_cache_hit_, | 341 "PnaclCoordinator: Got bad temp file handle from GetNexeFd")); |
349 temp_nexe_file_->internal_handle(), | 342 BitcodeStreamDidFinish(PP_ERROR_FAILED); |
350 cb.pp_completion_callback()); | 343 return; |
351 if (nexe_fd_err < PP_OK_COMPLETIONPENDING) { | |
352 ReportPpapiError(PP_NACL_ERROR_PNACL_CREATE_TEMP, nexe_fd_err, | |
353 nacl::string("Call to GetNexeFd failed")); | |
354 } | 344 } |
345 *temp_nexe_file_->internal_handle() = handle; | |
dmichael (off chromium)
2014/07/17 16:13:21
nit: This looks a bit weird to me; I think I'd pre
| |
346 // Open it for reading as the cached nexe file. | |
347 NexeReadDidOpen(temp_nexe_file_->Open(false)); | |
348 } | |
349 | |
350 void PnaclCoordinator::BitcodeStreamCacheMiss(int64_t expected_pexe_size) { | |
351 HistogramEnumerateTranslationCache(plugin_->uma_interface(), false); | |
352 expected_pexe_size_ = expected_pexe_size; | |
353 NexeFdDidOpen(PP_OK); | |
354 } | |
355 | |
356 void PnaclCoordinator::BitcodeStreamGotData(const void* data, int32_t length) { | |
357 DCHECK(translate_thread_.get()); | |
358 | |
359 translate_thread_->PutBytes(data, length); | |
360 if (data && length > 0) | |
361 pexe_size_ += length; | |
355 } | 362 } |
356 | 363 |
357 void PnaclCoordinator::NexeFdDidOpen(int32_t pp_error) { | 364 void PnaclCoordinator::NexeFdDidOpen(int32_t pp_error) { |
358 PLUGIN_PRINTF(("PnaclCoordinator::NexeFdDidOpen (pp_error=%" | |
359 NACL_PRId32 ", hit=%d)\n", pp_error, | |
360 is_cache_hit_ == PP_TRUE)); | |
361 if (pp_error < PP_OK) { | 365 if (pp_error < PP_OK) { |
362 ReportPpapiError(PP_NACL_ERROR_PNACL_CREATE_TEMP, pp_error, | 366 ReportPpapiError(PP_NACL_ERROR_PNACL_CREATE_TEMP, pp_error, |
363 nacl::string("GetNexeFd failed")); | 367 nacl::string("GetNexeFd failed")); |
364 return; | 368 return; |
365 } | 369 } |
366 | 370 |
367 if (*temp_nexe_file_->internal_handle() == PP_kInvalidFileHandle) { | 371 |
368 ReportNonPpapiError( | 372 // Open an object file first so the translator can start writing to it |
369 PP_NACL_ERROR_PNACL_CREATE_TEMP, | 373 // during streaming translation. |
370 nacl::string( | 374 temp_nexe_file_.reset(new TempFile(plugin_)); |
371 "PnaclCoordinator: Got bad temp file handle from GetNexeFd")); | 375 |
372 return; | 376 for (int i = 0; i < split_module_count_; i++) { |
377 nacl::scoped_ptr<TempFile> temp_file(new TempFile(plugin_)); | |
378 int32_t pp_error = temp_file->Open(true); | |
379 if (pp_error != PP_OK) { | |
380 ReportPpapiError(PP_NACL_ERROR_PNACL_CREATE_TEMP, | |
381 pp_error, | |
382 "Failed to open scratch object file."); | |
383 return; | |
384 } else { | |
385 obj_files_.push_back(temp_file.release()); | |
386 } | |
373 } | 387 } |
374 HistogramEnumerateTranslationCache(plugin_->uma_interface(), is_cache_hit_); | 388 invalid_desc_wrapper_.reset(plugin_->wrapper_factory()->MakeInvalid()); |
375 | 389 |
376 if (is_cache_hit_ == PP_TRUE) { | 390 // Open the nexe file for connecting ld and sel_ldr. |
377 // Cache hit -- no need to stream the rest of the file. | 391 // Start translation when done with this last step of setup! |
378 streaming_downloader_.reset(NULL); | 392 RunTranslate(temp_nexe_file_->Open(true)); |
379 // Open it for reading as the cached nexe file. | |
380 NexeReadDidOpen(temp_nexe_file_->Open(false)); | |
381 } else { | |
382 // Open an object file first so the translator can start writing to it | |
383 // during streaming translation. | |
384 for (int i = 0; i < split_module_count_; i++) { | |
385 nacl::scoped_ptr<TempFile> temp_file(new TempFile(plugin_)); | |
386 int32_t pp_error = temp_file->Open(true); | |
387 if (pp_error != PP_OK) { | |
388 ReportPpapiError(PP_NACL_ERROR_PNACL_CREATE_TEMP, | |
389 pp_error, | |
390 "Failed to open scratch object file."); | |
391 return; | |
392 } else { | |
393 obj_files_.push_back(temp_file.release()); | |
394 } | |
395 } | |
396 invalid_desc_wrapper_.reset(plugin_->wrapper_factory()->MakeInvalid()); | |
397 | |
398 // Meanwhile, a miss means we know we need to stream the bitcode, so stream | |
399 // the rest of it now. (Calling BeginStreaming means that the downloader | |
400 // will begin handing data to the coordinator, which is safe any time after | |
401 // the translate_thread_ object has been initialized). | |
402 pp::CompletionCallback finish_cb = callback_factory_.NewCallback( | |
403 &PnaclCoordinator::BitcodeStreamDidFinish); | |
404 streaming_downloader_->BeginStreaming(finish_cb); | |
405 | |
406 // Open the nexe file for connecting ld and sel_ldr. | |
407 // Start translation when done with this last step of setup! | |
408 RunTranslate(temp_nexe_file_->Open(true)); | |
409 } | |
410 } | 393 } |
411 | 394 |
412 void PnaclCoordinator::BitcodeStreamDidFinish(int32_t pp_error) { | 395 void PnaclCoordinator::BitcodeStreamDidFinish(int32_t pp_error) { |
413 PLUGIN_PRINTF(("PnaclCoordinator::BitcodeStreamDidFinish (pp_error=%" | 396 PLUGIN_PRINTF(("PnaclCoordinator::BitcodeStreamDidFinish (pp_error=%" |
414 NACL_PRId32 ")\n", pp_error)); | 397 NACL_PRId32 ")\n", pp_error)); |
415 if (pp_error != PP_OK) { | 398 if (pp_error != PP_OK) { |
416 // Defer reporting the error and cleanup until after the translation | 399 // Defer reporting the error and cleanup until after the translation |
417 // thread returns, because it may be accessing the coordinator's | 400 // thread returns, because it may be accessing the coordinator's |
418 // objects or writing to the files. | 401 // objects or writing to the files. |
419 translate_finish_error_ = pp_error; | 402 translate_finish_error_ = pp_error; |
420 if (pp_error == PP_ERROR_ABORTED) { | 403 if (pp_error == PP_ERROR_ABORTED) { |
421 error_info_.SetReport(PP_NACL_ERROR_PNACL_PEXE_FETCH_ABORTED, | 404 error_info_.SetReport(PP_NACL_ERROR_PNACL_PEXE_FETCH_ABORTED, |
422 "PnaclCoordinator: pexe load failed (aborted)."); | 405 "PnaclCoordinator: pexe load failed (aborted)."); |
423 } | 406 } |
424 if (pp_error == PP_ERROR_NOACCESS) { | 407 if (pp_error == PP_ERROR_NOACCESS) { |
425 error_info_.SetReport(PP_NACL_ERROR_PNACL_PEXE_FETCH_NOACCESS, | 408 error_info_.SetReport(PP_NACL_ERROR_PNACL_PEXE_FETCH_NOACCESS, |
426 "PnaclCoordinator: pexe load failed (no access)."); | 409 "PnaclCoordinator: pexe load failed (no access)."); |
427 } else { | 410 } else { |
428 nacl::stringstream ss; | 411 nacl::stringstream ss; |
429 ss << "PnaclCoordinator: pexe load failed (pp_error=" << pp_error << ")."; | 412 ss << "PnaclCoordinator: pexe load failed (pp_error=" << pp_error << ")."; |
430 error_info_.SetReport(PP_NACL_ERROR_PNACL_PEXE_FETCH_OTHER, ss.str()); | 413 error_info_.SetReport(PP_NACL_ERROR_PNACL_PEXE_FETCH_OTHER, ss.str()); |
431 } | 414 } |
432 translate_thread_->AbortSubprocesses(); | 415 |
416 if (translate_thread_->started()) | |
417 translate_thread_->AbortSubprocesses(); | |
418 else | |
419 TranslateFinished(pp_error); | |
433 } else { | 420 } else { |
434 // Compare download completion pct (100% now), to compile completion pct. | 421 // Compare download completion pct (100% now), to compile completion pct. |
435 HistogramRatio(plugin_->uma_interface(), | 422 HistogramRatio(plugin_->uma_interface(), |
436 "NaCl.Perf.PNaClLoadTime.PctCompiledWhenFullyDownloaded", | 423 "NaCl.Perf.PNaClLoadTime.PctCompiledWhenFullyDownloaded", |
437 pexe_bytes_compiled_, pexe_size_); | 424 pexe_bytes_compiled_, pexe_size_); |
438 } | |
439 } | |
440 | |
441 void PnaclCoordinator::BitcodeStreamGotData(int32_t pp_error, | |
442 FileStreamData data) { | |
443 PLUGIN_PRINTF(("PnaclCoordinator::BitcodeStreamGotData (pp_error=%" | |
444 NACL_PRId32 ", data=%p)\n", pp_error, data ? &(*data)[0] : 0)); | |
445 DCHECK(translate_thread_.get()); | |
446 | |
447 // When we have received data, pp_error is set to the number of bytes | |
448 // received. | |
449 if (pp_error > 0) { | |
450 CHECK(data); | |
451 translate_thread_->PutBytes(data, pp_error); | |
452 pexe_size_ += pp_error; | |
453 } else { | |
454 translate_thread_->EndStream(); | 425 translate_thread_->EndStream(); |
455 } | 426 } |
456 } | 427 } |
457 | 428 |
458 StreamCallback PnaclCoordinator::GetCallback() { | |
459 return callback_factory_.NewCallbackWithOutput( | |
460 &PnaclCoordinator::BitcodeStreamGotData); | |
461 } | |
462 | |
463 void PnaclCoordinator::BitcodeGotCompiled(int32_t pp_error, | 429 void PnaclCoordinator::BitcodeGotCompiled(int32_t pp_error, |
464 int64_t bytes_compiled) { | 430 int64_t bytes_compiled) { |
465 DCHECK(pp_error == PP_OK); | 431 DCHECK(pp_error == PP_OK); |
466 pexe_bytes_compiled_ += bytes_compiled; | 432 pexe_bytes_compiled_ += bytes_compiled; |
467 // If we don't know the expected total yet, ask. | 433 // If we don't know the expected total yet, ask. |
dmichael (off chromium)
2014/07/17 16:13:21
obsolete comment?
| |
468 if (expected_pexe_size_ == -1) { | 434 |
469 int64_t amount_downloaded; // dummy variable. | |
470 streaming_downloader_->GetDownloadProgress(&amount_downloaded, | |
471 &expected_pexe_size_); | |
472 } | |
473 // Hold off reporting the last few bytes of progress, since we don't know | 435 // Hold off reporting the last few bytes of progress, since we don't know |
474 // when they are actually completely compiled. "bytes_compiled" only means | 436 // when they are actually completely compiled. "bytes_compiled" only means |
475 // that bytes were sent to the compiler. | 437 // that bytes were sent to the compiler. |
476 if (expected_pexe_size_ != -1) { | 438 if (expected_pexe_size_ != -1) { |
477 if (!ShouldDelayProgressEvent()) { | 439 if (!ShouldDelayProgressEvent()) { |
478 GetNaClInterface()->DispatchEvent(plugin_->pp_instance(), | 440 GetNaClInterface()->DispatchEvent(plugin_->pp_instance(), |
479 PP_NACL_EVENT_PROGRESS, | 441 PP_NACL_EVENT_PROGRESS, |
480 pexe_url_.c_str(), | 442 pexe_url_.c_str(), |
481 PP_TRUE, | 443 PP_TRUE, |
482 pexe_bytes_compiled_, | 444 pexe_bytes_compiled_, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
519 invalid_desc_wrapper_.get(), | 481 invalid_desc_wrapper_.get(), |
520 &error_info_, | 482 &error_info_, |
521 resources_.get(), | 483 resources_.get(), |
522 &pnacl_options_, | 484 &pnacl_options_, |
523 architecture_attributes_, | 485 architecture_attributes_, |
524 this, | 486 this, |
525 plugin_); | 487 plugin_); |
526 } | 488 } |
527 | 489 |
528 } // namespace plugin | 490 } // namespace plugin |
OLD | NEW |