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

Unified Diff: extensions/browser/extension_message_filter.cc

Issue 280393003: Blobs: Catching browser-process created Blobs in extension code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | « extensions/browser/extension_message_filter.h ('k') | extensions/common/extension_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_message_filter.cc
diff --git a/extensions/browser/extension_message_filter.cc b/extensions/browser/extension_message_filter.cc
index 3cf93f03ec24b10667c7c79d0ff6daabe140fd09..e25480dcaf54317d778d4c3e369267d1c4d89f84 100644
--- a/extensions/browser/extension_message_filter.cc
+++ b/extensions/browser/extension_message_filter.cc
@@ -7,6 +7,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/resource_dispatcher_host.h"
+#include "extensions/browser/blob_holder.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_function_dispatcher.h"
#include "extensions/browser/extension_system.h"
@@ -44,6 +45,7 @@ void ExtensionMessageFilter::OverrideThreadForMessage(
case ExtensionHostMsg_RemoveFilteredListener::ID:
case ExtensionHostMsg_ShouldSuspendAck::ID:
case ExtensionHostMsg_SuspendAck::ID:
+ case ExtensionHostMsg_TransferBlobsAck::ID:
*thread = BrowserThread::UI;
break;
default:
@@ -70,6 +72,8 @@ bool ExtensionMessageFilter::OnMessageReceived(const IPC::Message& message) {
OnExtensionShouldSuspendAck)
IPC_MESSAGE_HANDLER(ExtensionHostMsg_SuspendAck,
OnExtensionSuspendAck)
+ IPC_MESSAGE_HANDLER(ExtensionHostMsg_TransferBlobsAck,
+ OnExtensionTransferBlobsAck)
IPC_MESSAGE_HANDLER(ExtensionHostMsg_GenerateUniqueID,
OnExtensionGenerateUniqueID)
IPC_MESSAGE_HANDLER(ExtensionHostMsg_ResumeRequests,
@@ -167,6 +171,14 @@ void ExtensionMessageFilter::OnExtensionSuspendAck(
process_manager->OnSuspendAck(extension_id);
}
+void ExtensionMessageFilter::OnExtensionTransferBlobsAck(
+ const std::vector<std::string>& blob_uuids) {
+ RenderProcessHost* process = RenderProcessHost::FromID(render_process_id_);
+ if (!process)
+ return;
+ BlobHolder::FromRenderProcessHost(process)->DropBlobs(blob_uuids);
+}
+
void ExtensionMessageFilter::OnExtensionGenerateUniqueID(int* unique_id) {
static int next_unique_id = 0;
*unique_id = ++next_unique_id;
« no previous file with comments | « extensions/browser/extension_message_filter.h ('k') | extensions/common/extension_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698