OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/nacl/renderer/ppb_nacl_private_impl.h" | 5 #include "components/nacl/renderer/ppb_nacl_private_impl.h" |
6 | 6 |
7 #include <numeric> | 7 #include <numeric> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 if(!sender->Send(new NaClHostMsg_NaClGetNumProcessors(&num_processors))) { | 580 if(!sender->Send(new NaClHostMsg_NaClGetNumProcessors(&num_processors))) { |
581 return 1; | 581 return 1; |
582 } | 582 } |
583 return num_processors; | 583 return num_processors; |
584 } | 584 } |
585 | 585 |
586 PP_Bool PPIsNonSFIModeEnabled() { | 586 PP_Bool PPIsNonSFIModeEnabled() { |
587 return PP_FromBool(IsNonSFIModeEnabled()); | 587 return PP_FromBool(IsNonSFIModeEnabled()); |
588 } | 588 } |
589 | 589 |
| 590 void GetNexeFdContinuation(scoped_refptr<ppapi::TrackedCallback> callback, |
| 591 PP_Bool* out_is_hit, |
| 592 PP_FileHandle* out_handle, |
| 593 int32_t pp_error, |
| 594 bool is_hit, |
| 595 PP_FileHandle handle) { |
| 596 if (pp_error == PP_OK) { |
| 597 *out_is_hit = PP_FromBool(is_hit); |
| 598 *out_handle = handle; |
| 599 } |
| 600 callback->PostRun(pp_error); |
| 601 } |
| 602 |
590 int32_t GetNexeFd(PP_Instance instance, | 603 int32_t GetNexeFd(PP_Instance instance, |
591 const char* pexe_url, | 604 const char* pexe_url, |
592 uint32_t abi_version, | 605 uint32_t abi_version, |
593 uint32_t opt_level, | 606 uint32_t opt_level, |
594 const char* http_headers_param, | 607 const char* http_headers_param, |
595 const char* extra_flags, | 608 const char* extra_flags, |
596 PP_Bool* is_hit, | 609 PP_Bool* is_hit, |
597 PP_FileHandle* handle, | 610 PP_FileHandle* handle, |
598 struct PP_CompletionCallback callback) { | 611 struct PP_CompletionCallback callback) { |
599 ppapi::thunk::EnterInstance enter(instance, callback); | 612 ppapi::thunk::EnterInstance enter(instance, callback); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
638 cache_info.last_modified = last_modified_time; | 651 cache_info.last_modified = last_modified_time; |
639 cache_info.etag = etag; | 652 cache_info.etag = etag; |
640 cache_info.has_no_store_header = has_no_store_header; | 653 cache_info.has_no_store_header = has_no_store_header; |
641 cache_info.sandbox_isa = GetSandboxArch(); | 654 cache_info.sandbox_isa = GetSandboxArch(); |
642 cache_info.extra_flags = std::string(extra_flags); | 655 cache_info.extra_flags = std::string(extra_flags); |
643 | 656 |
644 g_pnacl_resource_host.Get()->RequestNexeFd( | 657 g_pnacl_resource_host.Get()->RequestNexeFd( |
645 GetRoutingID(instance), | 658 GetRoutingID(instance), |
646 instance, | 659 instance, |
647 cache_info, | 660 cache_info, |
648 is_hit, | 661 base::Bind(&GetNexeFdContinuation, enter.callback(), is_hit, handle)); |
649 handle, | |
650 enter.callback()); | |
651 | 662 |
652 return enter.SetResult(PP_OK_COMPLETIONPENDING); | 663 return enter.SetResult(PP_OK_COMPLETIONPENDING); |
653 } | 664 } |
654 | 665 |
655 void ReportTranslationFinished(PP_Instance instance, | 666 void ReportTranslationFinished(PP_Instance instance, |
656 PP_Bool success, | 667 PP_Bool success, |
657 int32_t opt_level, | 668 int32_t opt_level, |
658 int64_t pexe_size, | 669 int64_t pexe_size, |
659 int64_t compile_time_us) { | 670 int64_t compile_time_us) { |
660 if (success == PP_TRUE) { | 671 if (success == PP_TRUE) { |
(...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1639 &SetPNaClStartTime | 1650 &SetPNaClStartTime |
1640 }; | 1651 }; |
1641 | 1652 |
1642 } // namespace | 1653 } // namespace |
1643 | 1654 |
1644 const PPB_NaCl_Private* GetNaClPrivateInterface() { | 1655 const PPB_NaCl_Private* GetNaClPrivateInterface() { |
1645 return &nacl_interface; | 1656 return &nacl_interface; |
1646 } | 1657 } |
1647 | 1658 |
1648 } // namespace nacl | 1659 } // namespace nacl |
OLD | NEW |