Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: components/nacl/renderer/pnacl_translation_resource_host.cc

Issue 1094653003: Refactor NaClProcessHost. Reduce chances to leak the resource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/nacl/common/nacl_host_messages.h" 7 #include "components/nacl/common/nacl_host_messages.h"
8 #include "ipc/ipc_sender.h"
8 #include "ppapi/c/pp_errors.h" 9 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/shared_impl/ppapi_globals.h" 10 #include "ppapi/shared_impl/ppapi_globals.h"
10 11
11 using ppapi::PpapiGlobals; 12 using ppapi::PpapiGlobals;
12 13
13 PnaclTranslationResourceHost::PnaclTranslationResourceHost( 14 PnaclTranslationResourceHost::PnaclTranslationResourceHost(
14 const scoped_refptr<base::MessageLoopProxy>& io_message_loop) 15 const scoped_refptr<base::MessageLoopProxy>& io_message_loop)
15 : io_message_loop_(io_message_loop), sender_(NULL) {} 16 : io_message_loop_(io_message_loop), sender_(NULL) {}
16 17
17 PnaclTranslationResourceHost::~PnaclTranslationResourceHost() { 18 PnaclTranslationResourceHost::~PnaclTranslationResourceHost() {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 ++it) { 143 ++it) {
143 PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask( 144 PpapiGlobals::Get()->GetMainThreadMessageLoop()->PostTask(
144 FROM_HERE, 145 FROM_HERE,
145 base::Bind(it->second, 146 base::Bind(it->second,
146 static_cast<int32_t>(PP_ERROR_ABORTED), 147 static_cast<int32_t>(PP_ERROR_ABORTED),
147 false, 148 false,
148 PP_kInvalidFileHandle)); 149 PP_kInvalidFileHandle));
149 } 150 }
150 pending_cache_requests_.clear(); 151 pending_cache_requests_.clear();
151 } 152 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698