| 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 "pnacl_translation_resource_host.h" | 5 #include "pnacl_translation_resource_host.h" |
| 6 | 6 |
| 7 #include "base/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
| 8 #include "components/nacl/common/nacl_host_messages.h" | 8 #include "components/nacl/common/nacl_host_messages.h" |
| 9 #include "ppapi/c/pp_errors.h" | 9 #include "ppapi/c/pp_errors.h" |
| 10 #include "ppapi/shared_impl/ppapi_globals.h" | 10 #include "ppapi/shared_impl/ppapi_globals.h" |
| 11 | 11 |
| 12 using ppapi::PpapiGlobals; | 12 using ppapi::PpapiGlobals; |
| 13 | 13 |
| 14 PnaclTranslationResourceHost::PnaclTranslationResourceHost( | 14 PnaclTranslationResourceHost::PnaclTranslationResourceHost( |
| 15 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner) | 15 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner) |
| 16 : io_task_runner_(io_task_runner), sender_(NULL) { | 16 : io_task_runner_(io_task_runner), sender_(NULL) { |
| 17 } | 17 } |
| 18 | 18 |
| 19 PnaclTranslationResourceHost::~PnaclTranslationResourceHost() { | 19 PnaclTranslationResourceHost::~PnaclTranslationResourceHost() { |
| 20 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 20 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| 21 CleanupCacheRequests(); | 21 CleanupCacheRequests(); |
| 22 } | 22 } |
| 23 | 23 |
| 24 void PnaclTranslationResourceHost::OnFilterAdded(IPC::Sender* sender) { | 24 void PnaclTranslationResourceHost::OnFilterAdded(IPC::Channel* channel) { |
| 25 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 25 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| 26 sender_ = sender; | 26 sender_ = channel; |
| 27 } | 27 } |
| 28 | 28 |
| 29 void PnaclTranslationResourceHost::OnFilterRemoved() { | 29 void PnaclTranslationResourceHost::OnFilterRemoved() { |
| 30 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 30 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| 31 sender_ = NULL; | 31 sender_ = NULL; |
| 32 } | 32 } |
| 33 | 33 |
| 34 void PnaclTranslationResourceHost::OnChannelClosing() { | 34 void PnaclTranslationResourceHost::OnChannelClosing() { |
| 35 DCHECK(io_task_runner_->BelongsToCurrentThread()); | 35 DCHECK(io_task_runner_->BelongsToCurrentThread()); |
| 36 sender_ = NULL; | 36 sender_ = NULL; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 ++it) { | 138 ++it) { |
| 139 PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( | 139 PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( |
| 140 FROM_HERE, | 140 FROM_HERE, |
| 141 base::Bind(it->second, | 141 base::Bind(it->second, |
| 142 static_cast<int32_t>(PP_ERROR_ABORTED), | 142 static_cast<int32_t>(PP_ERROR_ABORTED), |
| 143 false, | 143 false, |
| 144 PP_kInvalidFileHandle)); | 144 PP_kInvalidFileHandle)); |
| 145 } | 145 } |
| 146 pending_cache_requests_.clear(); | 146 pending_cache_requests_.clear(); |
| 147 } | 147 } |
| OLD | NEW |