Closed
Bug 517963
Opened 15 years ago
Closed 15 years ago
New-tab opening should not synclaunch the content process
Categories
(Core :: IPC, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: benjamin, Assigned: jdm)
References
Details
Attachments
(1 file, 5 obsolete files)
3.84 KB,
patch
|
Details | Diff | Splinter Review |
Currently opening an IPC-bound tab synchronously waits for the content process to launch. This is unacceptable and needs to be fixed to be asynchronous.
Assignee | ||
Comment 1•15 years ago
|
||
As far as I can tell this patch makes the content process launch asynchronously. The test shell works fine, and the main browser now crashes and burns with warnings about no docshells for remote frames.
Assignee | ||
Updated•15 years ago
|
Assignee: nobody → josh
Assignee | ||
Comment 2•15 years ago
|
||
The previous comment is misleading; the main browser was already crashing and burning without this patch. That behaviour has not changed.
Assignee | ||
Updated•15 years ago
|
Attachment #409087 -
Flags: review?(benjamin)
Reporter | ||
Comment 3•15 years ago
|
||
Comment on attachment 409087 [details] [diff] [review]
First pass at making content process launch async
>diff --git a/dom/ipc/ContentProcessParent.cpp b/dom/ipc/ContentProcessParent.cpp
>@@ -141,7 +140,7 @@
> mSubprocess = nsnull;
> mon.Notify();
> }
>-
>+
nit, extraneous whitespace.
>diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp
>+ MessageLoop* ioLoop =
>+ BrowserProcessSubThread::GetMessageLoop(BrowserProcessSubThread::IO);
>+ ioLoop->PostTask(FROM_HERE,
>+ NewRunnableMethod(this,
>+ &GeckoChildProcessHost::InitializeChannel));
nit, indent doesn't line up
>@@ -71,16 +78,13 @@
> {
> MessageLoop* loop = MessageLoop::current();
> MessageLoop* ioLoop =
>- BrowserProcessSubThread::GetMessageLoop(BrowserProcessSubThread::IO);
>+ BrowserProcessSubThread::GetMessageLoop(BrowserProcessSubThread::IO);
> NS_ASSERTION(loop != ioLoop, "sync launch from the IO thread NYI");
>-
>+
nit, whitespace and this reindent is incorrect
Please attach a patch with nits fixed and request review from cjones: I don't know the chromium+glue code enough to review this for content.
Attachment #409087 -
Flags: review?(benjamin)
Assignee | ||
Comment 4•15 years ago
|
||
Nits addressed.
Attachment #409087 -
Attachment is obsolete: true
Attachment #409962 -
Flags: review?
Assignee | ||
Updated•15 years ago
|
Attachment #409962 -
Flags: review? → review?(jones.chris.g)
Updated•15 years ago
|
Attachment #409962 -
Flags: review?(jones.chris.g) → review+
Comment on attachment 409962 [details] [diff] [review]
Same patch with nits addressed
diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
@@ -61,3 +62,4 @@
mProcessType(aProcessType),
mMonitor("mozilla.ipc.GeckChildProcessHost.mMonitor"),
mLaunched(false),
+ mInitialized(false),
Nit: I'd prefer this be called |mChannelInitialized|. |mInitialized| sounds like "subprocess initialized", which it isn't.
@@ -92,3 +99,17 @@
bool
GeckoChildProcessHost::AsyncLaunch(std::vector<std::wstring> aExtraOpts)
{
+ MessageLoop* ioLoop =
+ BrowserProcessSubThread::GetMessageLoop(BrowserProcessSubThread::IO);
+ ioLoop->PostTask(FROM_HERE,
+ NewRunnableMethod(this,
+ &GeckoChildProcessHost::PerformAsyncLaunch,
+ aExtraOpts));
+
+ // This may look like the sync launch wait, but we only delay as
+ // long as it takes to create the channel.
+ MonitorAutoEnter mon(mMonitor);
+ while (!mInitialized) {
+ mon.Wait();
+ }
+
Clever, nicely done.
I think it might be worthwhile to add a comment here (or in PerformAsyncLaunch()) noting that this code relies on InitializeChannel() and PerformAsyncLaunch() being processed in that order, by the IO thread. It would help future maintainers of the code get up to speed faster.
Assignee | ||
Comment 6•15 years ago
|
||
Nits addressed, comment added. I'm assuming the review carries over?
Attachment #409962 -
Attachment is obsolete: true
Assignee | ||
Comment 7•15 years ago
|
||
Just kidding, this is the actual changed patch. Silly hg qrefresh.
Attachment #410696 -
Attachment is obsolete: true
Assignee | ||
Comment 8•15 years ago
|
||
And it's already bitrotted. That was fast.
Attachment #410697 -
Attachment is obsolete: true
Assignee | ||
Comment 9•15 years ago
|
||
Can somebody with commit access push this?
Assignee | ||
Comment 10•15 years ago
|
||
Unbitrotted once again.
Attachment #410729 -
Attachment is obsolete: true
Assignee | ||
Comment 11•15 years ago
|
||
Assignee | ||
Comment 12•15 years ago
|
||
Whoops, I meant pushed as http://hg.mozilla.org/projects/electrolysis/rev/37f41c054914
Reporter | ||
Updated•15 years ago
|
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Version: unspecified → Other Branch
You need to log in
before you can comment on or make changes to this bug.
Description
•