| 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;
|
|
|