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

Issue 2173303002: Revert of Support early associated interface binding on ChannelMojo (Closed)

Created:
4 years, 5 months ago by Mark P
Modified:
4 years, 5 months ago
CC:
Aaron Boodman, abarth-chromium, ben+mojo_chromium.org, chromium-reviews, darin (slow to review), darin-cc_chromium.org, jam, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@explicit-channel-ipc-task-runner
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Revert of Support early associated interface binding on ChannelMojo (patchset #7 id:120001 of https://codereview.chromium.org/2163633003/ ) Reason for revert: Causes failures on Windows Unit (DrMemory) in memory test: ipc_tests https://build.chromium.org/p/chromium.memory.fyi/builders/Windows%20Unit%20%28DrMemory%29/builds/5360 --- IPCChannelMojoTest.SendFailWithPendingMessages: c:\b\build\slave\drm-cr\build\src\ipc\ipc_channel_mojo_unittest.cc(290): error: Value of: listener.has_error() Actual: false Expected: true --- Original issue's description: > Support early associated interface binding on ChannelMojo > > Changes the associated bindings implementation for ChannelMojo > such that remote interfaces can be acquired immediately upon > ChannelMojo construction rather than having to wait for connection > on the IO thread. > > Simplifies the Channel bootstrapping process, removing a round-trip > Init message (and in fact the entire IPC::mojom::Boostrap interface) > since there's no need to actually exchange associated interface handles > over the pipe. Instead both sides can assume the other will use a fixed, > reserved endpoint ID for their IPC::mojom::Channel interface. > > This also removes the restriction that associated interfaces must be > added to a Channel after Init. Instead the same constraints apply as > with AddFilter: an associated interface, like a filter, may be added > at any time as long as either Init hasn't been called OR the remote > process hasn't been launched. > > The result of this CL is that any place it's safe to AddFilter, > it's also safe to AddAssociatedInterface; and any place it's safe to > Send, it's also safe to GetRemoteAssociatedInterface and begin using > any such remote interface immediately. > > Remote interface requests as well as all messages to remote interfaces > retain FIFO with respect to any Send calls on the same thread. Local > interface request dispatch as well as all messages on locally bound > associated interfaces retain FIFO with respect to any OnMessageReceived > calls on the same thread. > > BUG=612500, 619202 > > Committed: https://crrev.com/e1037f997da9e1d44ca3b09d4ff32f0465673091 > Committed: https://crrev.com/508da24622f957a01b076ccd058bfdccc79068a4 > Committed: https://crrev.com/0e4de5f9a519c6cd206448a10eccc7a535e3db64 > Cr-Original-Original-Commit-Position: refs/heads/master@{#406720} > Cr-Original-Commit-Position: refs/heads/master@{#407050} > Cr-Commit-Position: refs/heads/master@{#407264} TBR=yzshen@chromium.org,rockot@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=612500, 619202

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+608 lines, -353 lines) Patch
M ipc/ipc.mojom View 1 chunk +10 lines, -6 lines 0 comments Download
M ipc/ipc_channel.h View 2 chunks +7 lines, -3 lines 0 comments Download
M ipc/ipc_channel_mojo.h View 5 chunks +26 lines, -11 lines 0 comments Download
M ipc/ipc_channel_mojo.cc View 8 chunks +98 lines, -56 lines 0 comments Download
M ipc/ipc_channel_mojo_unittest.cc View 6 chunks +13 lines, -15 lines 0 comments Download
M ipc/ipc_channel_proxy.h View 5 chunks +13 lines, -19 lines 0 comments Download
M ipc/ipc_channel_proxy.cc View 5 chunks +41 lines, -43 lines 0 comments Download
M ipc/ipc_message_pipe_reader.h View 5 chunks +17 lines, -4 lines 0 comments Download
M ipc/ipc_message_pipe_reader.cc View 3 chunks +10 lines, -10 lines 0 comments Download
M ipc/ipc_mojo_bootstrap.h View 2 chunks +40 lines, -8 lines 0 comments Download
M ipc/ipc_mojo_bootstrap.cc View 16 chunks +319 lines, -167 lines 0 comments Download
M ipc/ipc_mojo_bootstrap_unittest.cc View 4 chunks +13 lines, -9 lines 0 comments Download
M mojo/public/cpp/bindings/lib/interface_endpoint_client.cc View 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 5 (2 generated)
Mark P
Created Revert of Support early associated interface binding on ChannelMojo
4 years, 5 months ago (2016-07-23 03:57:31 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2173303002/1
4 years, 5 months ago (2016-07-23 03:57:43 UTC) #3
commit-bot: I haz the power
4 years, 5 months ago (2016-07-23 03:58:35 UTC) #5
Failed to apply patch for ipc/ipc_message_pipe_reader.cc:
While running git apply --index -3 -p1;
  error: patch failed: ipc/ipc_message_pipe_reader.cc:121
  Falling back to three-way merge...
  Applied patch to 'ipc/ipc_message_pipe_reader.cc' with conflicts.
  U ipc/ipc_message_pipe_reader.cc

Patch:       ipc/ipc_message_pipe_reader.cc
Index: ipc/ipc_message_pipe_reader.cc
diff --git a/ipc/ipc_message_pipe_reader.cc b/ipc/ipc_message_pipe_reader.cc
index
8e1b35565bfec09fbabb25835542fbd3e403f627..74c72858fcd179b8389583a85619b3eccb7dab19
100644
--- a/ipc/ipc_message_pipe_reader.cc
+++ b/ipc/ipc_message_pipe_reader.cc
@@ -55,8 +55,10 @@
     mojo::MessagePipeHandle pipe,
     mojom::ChannelAssociatedPtr sender,
     mojo::AssociatedInterfaceRequest<mojom::Channel> receiver,
+    base::ProcessId peer_pid,
     MessagePipeReader::Delegate* delegate)
     : delegate_(delegate),
+      peer_pid_(peer_pid),
       sender_(std::move(sender)),
       binding_(this, std::move(receiver)),
       sender_interface_id_(sender_.interface_id()),
@@ -121,15 +123,9 @@
   sender_->GetAssociatedInterface(name, std::move(request));
 }
 
-void MessagePipeReader::SetPeerPid(int32_t peer_pid) {
-  peer_pid_ = peer_pid;
-  delegate_->OnPeerPidReceived();
-}
-
 void MessagePipeReader::Receive(
     mojo::Array<uint8_t> data,
     mojo::Array<mojom::SerializedHandlePtr> handles) {
-  DCHECK_NE(peer_pid_, base::kNullProcessId);
   Message message(
       data.size() == 0 ? "" : reinterpret_cast<const char*>(&data[0]),
       static_cast<uint32_t>(data.size()));
@@ -160,12 +156,16 @@
 
 void MessagePipeReader::OnPipeError(MojoResult error) {
   DCHECK(thread_checker_.CalledOnValidThread());
-
-  Close();
-
-  // NOTE: The delegate call below may delete |this|.
   if (delegate_)
     delegate_->OnPipeError();
+  Close();
+}
+
+void MessagePipeReader::DelayedDeleter::operator()(
+    MessagePipeReader* ptr) const {
+  ptr->Close();
+  base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
+                                                base::Bind(&DeleteNow, ptr));
 }
 
 }  // namespace internal

Powered by Google App Engine
This is Rietveld 408576698