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

Side by Side Diff: chrome/browser/nacl_host/pnacl_host.cc

Issue 22309007: Add success status to ReportTranslationFinished in ppb_nacl_private and IPC (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unit test Created 7 years, 4 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 | Annotate | Revision Log
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 "chrome/browser/nacl_host/pnacl_host.h" 5 #include "chrome/browser/nacl_host/pnacl_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 173
174 CreateTemporaryFile( 174 CreateTemporaryFile(
175 process_handle, 175 process_handle,
176 base::Bind(&PnaclHost::ReturnMiss, 176 base::Bind(&PnaclHost::ReturnMiss,
177 weak_factory_.GetWeakPtr(), 177 weak_factory_.GetWeakPtr(),
178 TranslationID(render_process_id, pp_instance))); 178 TranslationID(render_process_id, pp_instance)));
179 } 179 }
180 180
181 /////////////////// Cleanup 181 /////////////////// Cleanup
182 182
183 void PnaclHost::TranslationFinished(int render_process_id, int pp_instance) { 183 void PnaclHost::TranslationFinished(int render_process_id,
184 int pp_instance,
185 bool success) {
dmichael (off chromium) 2013/08/06 18:53:58 You're not actually doing anything with |success|.
Derek Schuff 2013/08/06 21:21:13 I have another CL currently in flight which uses i
184 DCHECK(thread_checker_.CalledOnValidThread()); 186 DCHECK(thread_checker_.CalledOnValidThread());
185 if (cache_state_ != CacheReady) 187 if (cache_state_ != CacheReady)
186 return; 188 return;
187 PendingTranslationMap::iterator it(pending_translations_.find( 189 PendingTranslationMap::iterator it(pending_translations_.find(
188 TranslationID(render_process_id, pp_instance))); 190 TranslationID(render_process_id, pp_instance)));
189 if (it == pending_translations_.end()) { 191 if (it == pending_translations_.end()) {
190 LOG(ERROR) << "TranslationFinished: TranslationID " << render_process_id 192 LOG(ERROR) << "TranslationFinished: TranslationID " << render_process_id
191 << "," << pp_instance << " not found."; 193 << "," << pp_instance << " not found.";
192 } else { 194 } else {
193 pending_translations_.erase(it); 195 pending_translations_.erase(it);
194 } 196 }
195 } 197 }
196 198
197 void PnaclHost::RendererClosing(int render_process_id) { 199 void PnaclHost::RendererClosing(int render_process_id) {
198 if (cache_state_ != CacheReady) 200 if (cache_state_ != CacheReady)
199 return; 201 return;
200 DCHECK(thread_checker_.CalledOnValidThread()); 202 DCHECK(thread_checker_.CalledOnValidThread());
201 for (PendingTranslationMap::iterator it = pending_translations_.begin(); 203 for (PendingTranslationMap::iterator it = pending_translations_.begin();
202 it != pending_translations_.end();) { 204 it != pending_translations_.end();) {
203 PendingTranslationMap::iterator to_erase(it++); 205 PendingTranslationMap::iterator to_erase(it++);
204 if (to_erase->first.first == render_process_id) { 206 if (to_erase->first.first == render_process_id) {
205 // clean up the open files 207 // clean up the open files
206 pending_translations_.erase(to_erase); 208 pending_translations_.erase(to_erase);
207 } 209 }
208 } 210 }
209 } 211 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698