Chromium Code Reviews| Index: components/nacl/renderer/ppb_nacl_private_impl.cc |
| diff --git a/components/nacl/renderer/ppb_nacl_private_impl.cc b/components/nacl/renderer/ppb_nacl_private_impl.cc |
| index e5249445644f858a2a204c6dc572e5d3924050de..e534a82e4022d73d6c107953b5537434a784e41c 100644 |
| --- a/components/nacl/renderer/ppb_nacl_private_impl.cc |
| +++ b/components/nacl/renderer/ppb_nacl_private_impl.cc |
| @@ -21,6 +21,7 @@ |
| #include "components/nacl/renderer/manifest_service_channel.h" |
| #include "components/nacl/renderer/nexe_load_manager.h" |
| #include "components/nacl/renderer/pnacl_translation_resource_host.h" |
| +#include "components/nacl/renderer/progress_event.h" |
| #include "components/nacl/renderer/sandbox_arch.h" |
| #include "components/nacl/renderer/trusted_plugin_channel.h" |
| #include "content/public/common/content_client.h" |
| @@ -642,48 +643,18 @@ PP_FileHandle OpenNaClExecutable(PP_Instance instance, |
| return handle; |
| } |
| -void DispatchEventOnMainThread(PP_Instance instance, |
| - PP_NaClEventType event_type, |
| - const std::string& resource_url, |
| - PP_Bool length_is_computable, |
| - uint64_t loaded_bytes, |
| - uint64_t total_bytes); |
| - |
| void DispatchEvent(PP_Instance instance, |
| PP_NaClEventType event_type, |
| const char *resource_url, |
| PP_Bool length_is_computable, |
| uint64_t loaded_bytes, |
| uint64_t total_bytes) { |
| - ppapi::PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( |
| - FROM_HERE, |
| - base::Bind(&DispatchEventOnMainThread, |
| - instance, |
| - event_type, |
| - std::string(resource_url), |
| - length_is_computable, |
| - loaded_bytes, |
| - total_bytes)); |
| -} |
| - |
| -void DispatchEventOnMainThread(PP_Instance instance, |
| - PP_NaClEventType event_type, |
| - const std::string& resource_url, |
| - PP_Bool length_is_computable, |
| - uint64_t loaded_bytes, |
| - uint64_t total_bytes) { |
| - NexeLoadManager* load_manager = |
| - GetNexeLoadManager(instance); |
| - // The instance may have been destroyed after we were scheduled, so do |
| - // nothing if it's gone. |
| - if (load_manager) { |
| - NexeLoadManager::ProgressEvent event(event_type); |
| - event.resource_url = resource_url; |
| - event.length_is_computable = PP_ToBool(length_is_computable); |
| - event.loaded_bytes = loaded_bytes; |
| - event.total_bytes = total_bytes; |
| - load_manager->DispatchEvent(event); |
| - } |
| + ProgressEvent event(event_type); |
| + event.resource_url = resource_url; |
| + event.length_is_computable = PP_ToBool(length_is_computable); |
| + event.loaded_bytes = loaded_bytes; |
| + event.total_bytes = total_bytes; |
|
dmichael (off chromium)
2014/05/08 16:19:02
I don't particularly care, but this looks like it
teravest
2014/05/08 16:42:03
Done.
|
| + PostDispatchProgressEvent(instance, event); |
| } |
| void NexeFileDidOpen(PP_Instance instance, |