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

Unified Diff: content/common/fileapi/webblob_messages.h

Issue 2422793002: HTML MessagePort as mojo::MessagePipeHandle (Closed)
Patch Set: Cleanup Created 3 years, 11 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/common/fileapi/webblob_messages.h
diff --git a/content/common/fileapi/webblob_messages.h b/content/common/fileapi/webblob_messages.h
index 3b22b7f588e9883626dce4866b72e73a0f3fcb53..76d248454cdec42e6b05af48c393ac1fcb2f5cdd 100644
--- a/content/common/fileapi/webblob_messages.h
+++ b/content/common/fileapi/webblob_messages.h
@@ -54,11 +54,18 @@ IPC_STRUCT_TRAITS_END()
// * 'shortcut' transport the memory up to the IPC limit so the browser can use
// it if it's not currently full.
// See https://bit.ly/BlobStorageRefactor
-IPC_MESSAGE_CONTROL4(BlobStorageMsg_RegisterBlob,
- std::string /* uuid */,
- std::string /* content_type */,
- std::string /* content_disposition */,
- std::vector<storage::DataElement> /* item_descriptions */)
+//
+// NOTE: This message is synchronous to ensure that the browser is aware of the
+// UUID before the UUID is passed to another process. This protects against a
+// race condition in which the browser could be asked about a UUID that doesn't
+// yet exist from its perspective.
+//
+IPC_SYNC_MESSAGE_CONTROL4_0(
+ BlobStorageMsg_RegisterBlob,
+ std::string /* uuid */,
+ std::string /* content_type */,
+ std::string /* content_disposition */,
+ std::vector<storage::DataElement> /* item_descriptions */)
IPC_MESSAGE_CONTROL4(
BlobStorageMsg_RequestMemoryItem,
@@ -80,18 +87,28 @@ IPC_MESSAGE_CONTROL1(BlobHostMsg_IncrementRefCount,
std::string /* uuid */)
IPC_MESSAGE_CONTROL1(BlobHostMsg_DecrementRefCount,
std::string /* uuid */)
-IPC_MESSAGE_CONTROL2(BlobHostMsg_RegisterPublicURL,
- GURL,
- std::string /* uuid */)
+// NOTE: This message is synchronous to ensure that the browser is aware of the
+// URL before the URL is passed to another process. This protects against a
+// race condition in which the browser could be asked to load an URL that
+// doesn't yet exist from its perspective.
+IPC_SYNC_MESSAGE_CONTROL2_0(BlobHostMsg_RegisterPublicURL,
+ GURL,
+ std::string /* uuid */)
IPC_MESSAGE_CONTROL1(BlobHostMsg_RevokePublicURL,
GURL)
// Stream messages sent from the renderer to the browser.
// Registers a stream as being built.
-IPC_MESSAGE_CONTROL2(StreamHostMsg_StartBuilding,
- GURL /* url */,
- std::string /* content_type */)
+//
+// NOTE: This message is synchronous to ensure that the browser is aware of the
+// URL before the URL is passed to another process. This protects against a
+// race condition in which the browser could be asked to load an URL that
+// doesn't yet exist from its perspective.
+//
+IPC_SYNC_MESSAGE_CONTROL2_0(StreamHostMsg_StartBuilding,
+ GURL /* url */,
+ std::string /* content_type */)
// Appends data to a stream being built.
IPC_MESSAGE_CONTROL2(StreamHostMsg_AppendBlobDataItem,
@@ -117,9 +134,15 @@ IPC_MESSAGE_CONTROL1(StreamHostMsg_AbortBuilding,
GURL /* url */)
// Creates a new stream that's a clone of an existing src stream.
-IPC_MESSAGE_CONTROL2(StreamHostMsg_Clone,
- GURL /* url */,
- GURL /* src_url */)
+//
+// NOTE: This message is synchronous to ensure that the browser is aware of the
+// URL before the URL is passed to another process. This protects against a
+// race condition in which the browser could be asked to load an URL that
+// doesn't yet exist from its perspective.
+//
+IPC_SYNC_MESSAGE_CONTROL2_0(StreamHostMsg_Clone,
+ GURL /* url */,
+ GURL /* src_url */)
// Removes a stream.
IPC_MESSAGE_CONTROL1(StreamHostMsg_Remove,

Powered by Google App Engine
This is Rietveld 408576698