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

Unified Diff: content/child/blob_storage/blob_transport_controller.cc

Issue 1985383002: Logging and check fail crbug/612358 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleaned up logging Created 4 years, 7 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 | « content/browser/service_worker/service_worker_url_request_job.cc ('k') | net/log/net_log_event_type_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/blob_storage/blob_transport_controller.cc
diff --git a/content/child/blob_storage/blob_transport_controller.cc b/content/child/blob_storage/blob_transport_controller.cc
index 0bcadbc85d30e80ac8d13d4cbaad0b5864627a04..34efe32175739941ceb2ddf3db4646b73865295b 100644
--- a/content/child/blob_storage/blob_transport_controller.cc
+++ b/content/child/blob_storage/blob_transport_controller.cc
@@ -11,6 +11,7 @@
#include "base/memory/scoped_vector.h"
#include "base/memory/shared_memory.h"
#include "base/single_thread_task_runner.h"
+#include "base/threading/platform_thread.h"
#include "base/stl_util.h"
#include "content/child/blob_storage/blob_consolidation.h"
#include "content/child/child_process.h"
@@ -66,6 +67,13 @@ void BlobTransportController::InitiateBlobTransfer(
scoped_refptr<ThreadSafeSender> sender,
base::SingleThreadTaskRunner* io_runner,
scoped_refptr<base::SingleThreadTaskRunner> main_runner) {
+ BlobTransportController* controller = BlobTransportController::GetInstance();
+ if (consolidation->total_memory() > kBlobStorageIPCThresholdBytes) {
+ LOG(ERROR)
+ << uuid
+ << " is about to be saved and send messages to browser. Instance: "
+ << controller << ", " << base::PlatformThread::GetName();
+ }
if (main_runner->BelongsToCurrentThread()) {
IncChildProcessRefCount();
} else {
@@ -104,6 +112,8 @@ void BlobTransportController::OnMemoryRequest(
case ResponsesStatus::BLOB_NOT_FOUND:
// sender->Send(new BlobStorageMsg_CancelBuildingBlob(uuid,
// IPCBlobCreationCancelCode::UNKNOWN));
+ CHECK(false) << "Could not find " << uuid << " Instance: " << this << ", "
+ << base::PlatformThread::GetName();
return;
case ResponsesStatus::SHARED_MEMORY_MAP_FAILED:
// This would happen if the renderer process doesn't have enough memory
@@ -123,12 +133,21 @@ void BlobTransportController::OnMemoryRequest(
void BlobTransportController::OnCancel(
const std::string& uuid,
storage::IPCBlobCreationCancelCode code) {
- DVLOG(1) << "Received blob cancel for blob " << uuid
+ LOG(ERROR) << "Received blob cancel for blob " << uuid
<< " with code: " << static_cast<int>(code);
ReleaseBlobConsolidation(uuid);
}
void BlobTransportController::OnDone(const std::string& uuid) {
+
+ auto it = blob_storage_.find(uuid);
+ if (it != blob_storage_.end()) {
+
+ BlobConsolidation* consolidation = it->second.get();
+ if (consolidation->total_memory() > kBlobStorageIPCThresholdBytes) {
+ LOG(ERROR) << uuid << " got done for shared memory.";
+ }
+ }
ReleaseBlobConsolidation(uuid);
}
@@ -202,9 +221,14 @@ void BlobTransportController::StoreBlobDataForRequests(
const std::string& uuid,
std::unique_ptr<BlobConsolidation> consolidation,
scoped_refptr<base::SingleThreadTaskRunner> main_runner) {
+
if (!main_thread_runner_.get()) {
main_thread_runner_ = std::move(main_runner);
}
+ if (consolidation->total_memory() > kBlobStorageIPCThresholdBytes) {
+ LOG(ERROR) << uuid << " storing shared memory consolidation on "
+ << base::PlatformThread::GetName();
+ }
blob_storage_[uuid] = std::move(consolidation);
}
@@ -249,6 +273,8 @@ BlobTransportController::ResponsesStatus BlobTransportController::GetResponses(
break;
}
case IPCBlobItemRequestStrategy::SHARED_MEMORY: {
+ LOG(ERROR) << uuid << " got shared memory request on "
+ << base::PlatformThread::GetName();
DCHECK_LT(request.handle_index, memory_handles->size())
<< "Invalid handle index.";
SharedMemory* memory = opened_memory[request.handle_index];
@@ -267,7 +293,7 @@ BlobTransportController::ResponsesStatus BlobTransportController::GetResponses(
request.renderer_item_index, request.renderer_item_offset,
request.size,
static_cast<char*>(memory->memory()) + request.handle_offset);
- DCHECK(status == ReadStatus::OK)
+ CHECK(status == ReadStatus::OK)
<< "Error reading from consolidated blob: "
<< static_cast<int>(status);
break;
« no previous file with comments | « content/browser/service_worker/service_worker_url_request_job.cc ('k') | net/log/net_log_event_type_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698