| Index: chrome/renderer/pepper/pnacl_translation_resource_host.cc
|
| diff --git a/chrome/renderer/pepper/pnacl_translation_resource_host.cc b/chrome/renderer/pepper/pnacl_translation_resource_host.cc
|
| index 609ddecf3ba24a8cf1d47a10ba7e422d5f988e04..0546c75f35a83ba4b0933f2bdeb27c20a7e8f571 100644
|
| --- a/chrome/renderer/pepper/pnacl_translation_resource_host.cc
|
| +++ b/chrome/renderer/pepper/pnacl_translation_resource_host.cc
|
| @@ -27,7 +27,6 @@ PnaclTranslationResourceHost::PnaclTranslationResourceHost(
|
| PnaclTranslationResourceHost::~PnaclTranslationResourceHost() {
|
| DCHECK(io_message_loop_->BelongsToCurrentThread());
|
| CleanupCacheRequests();
|
| - CleanupEnsurePnaclRequests();
|
| }
|
|
|
| void PnaclTranslationResourceHost::OnFilterAdded(IPC::Channel* channel) {
|
| @@ -51,8 +50,6 @@ bool PnaclTranslationResourceHost::OnMessageReceived(
|
| bool handled = true;
|
| IPC_BEGIN_MESSAGE_MAP(PnaclTranslationResourceHost, message)
|
| IPC_MESSAGE_HANDLER(NaClViewMsg_NexeTempFileReply, OnNexeTempFileReply)
|
| - IPC_MESSAGE_HANDLER(NaClViewMsg_EnsurePnaclInstalledReply,
|
| - OnEnsurePnaclInstalledReply)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| IPC_END_MESSAGE_MAP()
|
| return handled;
|
| @@ -168,70 +165,4 @@ void PnaclTranslationResourceHost::CleanupCacheRequests() {
|
| pending_cache_requests_.clear();
|
| }
|
|
|
| -void PnaclTranslationResourceHost::EnsurePnaclInstalled(
|
| - PP_Instance instance,
|
| - scoped_refptr<TrackedCallback> callback) {
|
| - DCHECK(PpapiGlobals::Get()->
|
| - GetMainThreadMessageLoop()->BelongsToCurrentThread());
|
| - io_message_loop_->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&PnaclTranslationResourceHost::SendEnsurePnaclInstalled,
|
| - this, instance, callback));
|
| - return;
|
| -}
|
| -
|
| -void PnaclTranslationResourceHost::SendEnsurePnaclInstalled(
|
| - PP_Instance instance,
|
| - scoped_refptr<TrackedCallback> callback) {
|
| - DCHECK(io_message_loop_->BelongsToCurrentThread());
|
| - // If a request is already in, just queue this one and wait for notification.
|
| - // Hope that the request is not canceled.
|
| - if (pending_ensure_pnacl_requests_.size() > 0) {
|
| - pending_ensure_pnacl_requests_.push_back(callback);
|
| - return;
|
| - }
|
| - // Otherwise, try to send the request, then queue.
|
| - if (!channel_ || !channel_->Send(new NaClHostMsg_EnsurePnaclInstalled(
|
| - instance))) {
|
| - PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&TrackedCallback::Run,
|
| - callback,
|
| - static_cast<int32_t>(PP_ERROR_FAILED)));
|
| - return;
|
| - }
|
| - pending_ensure_pnacl_requests_.push_back(callback);
|
| -}
|
| -
|
| -void PnaclTranslationResourceHost::OnEnsurePnaclInstalledReply(
|
| - PP_Instance instance,
|
| - bool success) {
|
| - DCHECK(io_message_loop_->BelongsToCurrentThread());
|
| - // Broadcast to all listeners.
|
| - for (EnsurePnaclInstalledList::iterator
|
| - i = pending_ensure_pnacl_requests_.begin(),
|
| - e = pending_ensure_pnacl_requests_.end();
|
| - i != e; ++i) {
|
| - if (TrackedCallback::IsPending(*i)) {
|
| - PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&TrackedCallback::Run,
|
| - *i,
|
| - static_cast<int32_t>(success ? PP_OK : PP_ERROR_FAILED)));
|
| - }
|
| - }
|
| - pending_ensure_pnacl_requests_.clear();
|
| -}
|
| -
|
| -void PnaclTranslationResourceHost::CleanupEnsurePnaclRequests() {
|
| - DCHECK(io_message_loop_->BelongsToCurrentThread());
|
| - for (EnsurePnaclInstalledList::iterator
|
| - i = pending_ensure_pnacl_requests_.begin(),
|
| - e = pending_ensure_pnacl_requests_.end();
|
| - i != e; ++i) {
|
| - (*i)->PostAbort();
|
| - }
|
| - pending_ensure_pnacl_requests_.clear();
|
| -}
|
| -
|
| #endif // DISABLE_NACL
|
|
|