Index: content/child/blob_storage/blob_message_filter.cc |
diff --git a/content/child/blob_storage/blob_message_filter.cc b/content/child/blob_storage/blob_message_filter.cc |
index 19491d655fd7eff0dee1f9f8e665b0836480ee54..66ec62de411a4e86a7029952b63d0f0ba34ca850 100644 |
--- a/content/child/blob_storage/blob_message_filter.cc |
+++ b/content/child/blob_storage/blob_message_filter.cc |
@@ -4,17 +4,21 @@ |
#include "content/child/blob_storage/blob_message_filter.h" |
+#include "base/bind.h" |
+#include "base/task_runner.h" |
#include "content/child/blob_storage/blob_transport_controller.h" |
#include "content/child/thread_safe_sender.h" |
#include "content/common/fileapi/webblob_messages.h" |
#include "ipc/ipc_message.h" |
#include "ipc/ipc_sender.h" |
#include "storage/common/blob_storage/blob_item_bytes_request.h" |
+#include "storage/common/blob_storage/blob_item_bytes_response.h" |
namespace content { |
-BlobMessageFilter::BlobMessageFilter() |
- : IPC::MessageFilter(), sender_(nullptr) {} |
+BlobMessageFilter::BlobMessageFilter( |
+ scoped_refptr<base::TaskRunner> file_runner) |
+ : sender_(nullptr), file_runner_(std::move(file_runner)) {} |
BlobMessageFilter::~BlobMessageFilter() {} |
@@ -22,6 +26,11 @@ void BlobMessageFilter::OnFilterAdded(IPC::Sender* sender) { |
sender_ = sender; |
} |
+void BlobMessageFilter::OnChannelClosing() { |
+ BlobTransportController::GetInstance()->CancelAllBlobTransfers(); |
+ sender_ = nullptr; |
+} |
+ |
bool BlobMessageFilter::OnMessageReceived(const IPC::Message& message) { |
bool handled = true; |
IPC_BEGIN_MESSAGE_MAP(BlobMessageFilter, message) |
@@ -45,7 +54,8 @@ void BlobMessageFilter::OnRequestMemoryItem( |
std::vector<base::SharedMemoryHandle> memory_handles, |
const std::vector<IPC::PlatformFileForTransit>& file_handles) { |
BlobTransportController::GetInstance()->OnMemoryRequest( |
- uuid, requests, &memory_handles, file_handles, sender_); |
+ uuid, requests, &memory_handles, file_handles, file_runner_.get(), |
+ sender_); |
} |
void BlobMessageFilter::OnCancelBuildingBlob( |