| 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 #ifdef _MSC_VER | 5 #ifdef _MSC_VER |
| 6 // Do not warn about use of std::copy with raw pointers. | 6 // Do not warn about use of std::copy with raw pointers. |
| 7 #pragma warning(disable : 4996) | 7 #pragma warning(disable : 4996) |
| 8 #endif | 8 #endif |
| 9 | 9 |
| 10 #include "ppapi/native_client/src/trusted/plugin/plugin.h" | 10 #include "ppapi/native_client/src/trusted/plugin/plugin.h" |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 void Plugin::RequestNaClManifest(const nacl::string& url) { | 554 void Plugin::RequestNaClManifest(const nacl::string& url) { |
| 555 PLUGIN_PRINTF(("Plugin::RequestNaClManifest (url='%s')\n", url.c_str())); | 555 PLUGIN_PRINTF(("Plugin::RequestNaClManifest (url='%s')\n", url.c_str())); |
| 556 pp::CompletionCallback open_callback = | 556 pp::CompletionCallback open_callback = |
| 557 callback_factory_.NewCallback(&Plugin::NaClManifestFileDidOpen); | 557 callback_factory_.NewCallback(&Plugin::NaClManifestFileDidOpen); |
| 558 nacl_interface_->RequestNaClManifest(pp_instance(), | 558 nacl_interface_->RequestNaClManifest(pp_instance(), |
| 559 url.c_str(), | 559 url.c_str(), |
| 560 &manifest_id_, | 560 &manifest_id_, |
| 561 open_callback.pp_completion_callback()); | 561 open_callback.pp_completion_callback()); |
| 562 } | 562 } |
| 563 | 563 |
| 564 void Plugin::StreamAsFile(const nacl::string& url, | |
| 565 PP_NaClFileInfo* file_info, | |
| 566 const pp::CompletionCallback& callback) { | |
| 567 PLUGIN_PRINTF(("Plugin::StreamAsFile (url='%s')\n", url.c_str())); | |
| 568 nacl_interface_->DownloadFile(pp_instance(), | |
| 569 url.c_str(), | |
| 570 file_info, | |
| 571 callback.pp_completion_callback()); | |
| 572 } | |
| 573 | |
| 574 void Plugin::ReportLoadSuccess(uint64_t loaded_bytes, uint64_t total_bytes) { | 564 void Plugin::ReportLoadSuccess(uint64_t loaded_bytes, uint64_t total_bytes) { |
| 575 nacl_interface_->ReportLoadSuccess( | 565 nacl_interface_->ReportLoadSuccess( |
| 576 pp_instance(), program_url_.c_str(), loaded_bytes, total_bytes); | 566 pp_instance(), program_url_.c_str(), loaded_bytes, total_bytes); |
| 577 } | 567 } |
| 578 | 568 |
| 579 | 569 |
| 580 void Plugin::ReportLoadError(const ErrorInfo& error_info) { | 570 void Plugin::ReportLoadError(const ErrorInfo& error_info) { |
| 581 nacl_interface_->ReportLoadError(pp_instance(), | 571 nacl_interface_->ReportLoadError(pp_instance(), |
| 582 error_info.error_code(), | 572 error_info.error_code(), |
| 583 error_info.message().c_str(), | 573 error_info.message().c_str(), |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 636 | 626 |
| 637 void Plugin::SetExitStatusOnMainThread(int32_t pp_error, | 627 void Plugin::SetExitStatusOnMainThread(int32_t pp_error, |
| 638 int exit_status) { | 628 int exit_status) { |
| 639 DCHECK(pp::Module::Get()->core()->IsMainThread()); | 629 DCHECK(pp::Module::Get()->core()->IsMainThread()); |
| 640 DCHECK(nacl_interface_); | 630 DCHECK(nacl_interface_); |
| 641 nacl_interface_->SetExitStatus(pp_instance(), exit_status); | 631 nacl_interface_->SetExitStatus(pp_instance(), exit_status); |
| 642 } | 632 } |
| 643 | 633 |
| 644 | 634 |
| 645 } // namespace plugin | 635 } // namespace plugin |
| OLD | NEW |