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

Unified Diff: chrome/browser/nacl_host/pnacl_translation_cache.cc

Issue 22608005: Add extra error logging to PnaclTranslationCache and PnaclHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/nacl_host/pnacl_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/nacl_host/pnacl_translation_cache.cc
diff --git a/chrome/browser/nacl_host/pnacl_translation_cache.cc b/chrome/browser/nacl_host/pnacl_translation_cache.cc
index 48498d0e59abaf4cc514ebacc3cd287e799d3828..508c665be5e807135ef29921ad20c524c0e7ee44 100644
--- a/chrome/browser/nacl_host/pnacl_translation_cache.cc
+++ b/chrome/browser/nacl_host/pnacl_translation_cache.cc
@@ -198,8 +198,11 @@ void PnaclTranslationCacheEntry::ReadEntry(int offset, int len) {
void PnaclTranslationCacheEntry::CloseEntry(int rv) {
DCHECK(entry_);
- if (rv < 0)
+ if (rv < 0) {
+ LOG(ERROR) << "PnaclTranslationCache: failed to close entry: "
+ << net::ErrorToString(rv);
entry_->Doom();
+ }
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE, base::Bind(&CloseDiskCacheEntry, entry_));
Finish(rv);
@@ -227,7 +230,7 @@ void PnaclTranslationCacheEntry::DispatchNext(int rv) {
switch (step_) {
case UNINITIALIZED:
- LOG(ERROR) << "Unexpected step in DispatchNext";
+ LOG(ERROR) << "PnaclTranslationCache: DispatchNext called uninitialized";
break;
case OPEN_ENTRY:
@@ -242,6 +245,11 @@ void PnaclTranslationCacheEntry::DispatchNext(int rv) {
WriteEntry(0, io_buf_->size());
}
} else {
+ if (rv != net::ERR_FAILED) {
+ // ERROR_FAILED is what we expect if the entry doesn't exist.
+ LOG(ERROR) << "PnaclTranslationCache: OpenEntry failed: "
+ << net::ErrorToString(rv);
+ }
if (is_read_) {
// Just a cache miss, not necessarily an error.
entry_ = NULL;
@@ -258,7 +266,8 @@ void PnaclTranslationCacheEntry::DispatchNext(int rv) {
step_ = TRANSFER_ENTRY;
WriteEntry(io_buf_->BytesConsumed(), io_buf_->BytesRemaining());
} else {
- LOG(ERROR) << "Failed to Create a PNaCl Translation Cache Entry";
+ LOG(ERROR) << "PnaclTranslationCache: Failed to Create Entry: "
+ << net::ErrorToString(rv);
Finish(rv);
}
break;
@@ -268,8 +277,8 @@ void PnaclTranslationCacheEntry::DispatchNext(int rv) {
// We do not call DispatchNext directly if WriteEntry/ReadEntry returns
// ERR_IO_PENDING, and the callback should not return that value either.
LOG(ERROR)
- << "Failed to complete write to PNaCl Translation Cache Entry: "
- << rv;
+ << "PnaclTranslationCache: Failed to complete write to entry: "
+ << net::ErrorToString(rv);
step_ = CLOSE_ENTRY;
CloseEntry(rv);
break;
@@ -342,6 +351,10 @@ int PnaclTranslationCache::Init(net::CacheType cache_type,
}
void PnaclTranslationCache::OnCreateBackendComplete(int rv) {
+ if (rv < 0) {
+ LOG(ERROR) << "PnaclTranslationCache: backend init failed:"
+ << net::ErrorToString(rv);
+ }
// Invoke our client's callback function.
if (!init_callback_.is_null()) {
init_callback_.Run(rv);
« no previous file with comments | « chrome/browser/nacl_host/pnacl_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698