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

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

Issue 1414123002: [BlobAsync] Renderer support for blob file writing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blob-hookup
Patch Set: comments 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
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(

Powered by Google App Engine
This is Rietveld 408576698