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

Issue 7779040: Start moving code from BrowserMain to content, so that it can be reused by all embedders of conte... (Closed)

Created:
9 years, 3 months ago by jam
Modified:
9 years, 3 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, davemoore+watch_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

Start moving code from BrowserMain to content, so that it can be reused by all embedders of content. I've based the refactoring on the existing BrowserMainParts. This is the first step; I didn't want to do it all at the same time because it would be too big. Remaining tasks: -rename the browser_main files in chrome to chrome_browser_main -move the OS specific implementations of BrowserMainParts that are needed for content -finish splitting the remaining BrowserMain function (now that's in TemporaryContinue()) BUG=90445 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=99884

Patch Set 1 : '' #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Patch Set 9 : sync #

Patch Set 10 : sync #

Patch Set 11 : sync #

Total comments: 8

Patch Set 12 : '' #

Patch Set 13 : fix windows unittest #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+979 lines, -773 lines) Patch
M chrome/app/chrome_main.cc View 1 2 3 4 5 6 7 8 9 chunks +9 lines, -55 lines 0 comments Download
M chrome/browser/browser_main.h View 1 2 3 4 5 6 7 8 6 chunks +14 lines, -106 lines 0 comments Download
M chrome/browser/browser_main.cc View 1 2 3 4 5 6 7 8 9 10 54 chunks +107 lines, -387 lines 5 comments Download
M chrome/browser/browser_main_gtk.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/browser_main_gtk.cc View 1 2 3 4 5 6 7 8 3 chunks +8 lines, -8 lines 0 comments Download
A chrome/browser/browser_main_mac.h View 1 2 1 chunk +20 lines, -0 lines 0 comments Download
M chrome/browser/browser_main_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +67 lines, -73 lines 0 comments Download
M chrome/browser/browser_main_posix.h View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -6 lines 0 comments Download
M chrome/browser/browser_main_posix.cc View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/browser_main_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +25 lines, -10 lines 0 comments Download
M chrome/browser/browser_main_win.h View 1 2 3 4 5 6 7 8 2 chunks +11 lines, -0 lines 0 comments Download
M chrome/browser/browser_main_win.cc View 1 2 3 4 5 6 7 8 3 chunks +30 lines, -37 lines 0 comments Download
M chrome/browser/browser_process_impl.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chrome_content_browser_client.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 7 8 3 chunks +23 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/browser_main_chromeos.h View 1 2 3 4 5 6 7 8 1 chunk +7 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/browser_main_chromeos.cc View 1 2 3 4 5 6 7 8 2 chunks +35 lines, -6 lines 0 comments Download
M chrome/browser/chromeos/net/network_change_notifier_chromeos.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/gtk/gtk_util.h View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/ui/gtk/gtk_util.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -29 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/chrome_dll.gypi View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/chrome_constants.h View 1 2 3 4 5 6 7 8 2 chunks +0 lines, -4 lines 0 comments Download
M chrome/common/chrome_constants.cc View 1 2 3 4 5 6 7 8 2 chunks +0 lines, -5 lines 0 comments Download
M chrome/common/chrome_switches.h View 1 2 3 4 5 6 7 8 4 chunks +0 lines, -7 lines 0 comments Download
M chrome/common/chrome_switches.cc View 1 2 3 4 5 6 7 8 6 chunks +0 lines, -25 lines 0 comments Download
M content/app/content_main.cc View 1 2 3 4 5 6 7 8 6 chunks +52 lines, -0 lines 0 comments Download
A content/browser/browser_main.h View 1 chunk +133 lines, -0 lines 0 comments Download
A content/browser/browser_main.cc View 1 2 3 4 5 1 chunk +319 lines, -0 lines 0 comments Download
M content/browser/content_browser_client.h View 1 2 3 4 5 6 7 8 3 chunks +12 lines, -0 lines 0 comments Download
M content/browser/mock_content_browser_client.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/mock_content_browser_client.cc View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -0 lines 0 comments Download
M content/common/content_constants.h View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -0 lines 0 comments Download
M content/common/content_constants.cc View 1 2 3 4 5 6 7 8 1 chunk +11 lines, -2 lines 0 comments Download
M content/common/content_switches.h View 1 2 3 4 5 6 7 8 3 chunks +7 lines, -0 lines 0 comments Download
M content/common/content_switches.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +27 lines, -3 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M ui/gfx/gtk_util.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -0 lines 0 comments Download
M ui/gfx/gtk_util.cc View 1 2 3 4 5 6 7 8 1 chunk +29 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
jam
9 years, 3 months ago (2011-09-06 06:51:36 UTC) #1
viettrungluu
If you can get this to build, pass tests, etc., then you have a mostly-rubberstamp ...
9 years, 3 months ago (2011-09-06 21:31:42 UTC) #2
jam
http://codereview.chromium.org/7779040/diff/14003/chrome/browser/browser_main_mac.mm File chrome/browser/browser_main_mac.mm (right): http://codereview.chromium.org/7779040/diff/14003/chrome/browser/browser_main_mac.mm#newcode91 chrome/browser/browser_main_mac.mm:91: // Tell Cooca to finish its initalization, which we ...
9 years, 3 months ago (2011-09-06 21:50:41 UTC) #3
satorux1
http://codereview.chromium.org/7779040/diff/11053/chrome/browser/browser_main.cc File chrome/browser/browser_main.cc (left): http://codereview.chromium.org/7779040/diff/11053/chrome/browser/browser_main.cc#oldcode2183 chrome/browser/browser_main.cc:2183: parts.reset(NULL); The comment says the BrowserMainParts is explicitly released, ...
9 years, 3 months ago (2011-09-07 17:10:31 UTC) #4
jam
http://codereview.chromium.org/7779040/diff/11053/chrome/browser/browser_main.cc File chrome/browser/browser_main.cc (left): http://codereview.chromium.org/7779040/diff/11053/chrome/browser/browser_main.cc#oldcode2183 chrome/browser/browser_main.cc:2183: parts.reset(NULL); On 2011/09/07 17:10:31, satorux1 wrote: > The comment ...
9 years, 3 months ago (2011-09-07 17:37:48 UTC) #5
satorux1
http://codereview.chromium.org/7779040/diff/11053/chrome/browser/browser_main.cc File chrome/browser/browser_main.cc (left): http://codereview.chromium.org/7779040/diff/11053/chrome/browser/browser_main.cc#oldcode2183 chrome/browser/browser_main.cc:2183: parts.reset(NULL); On 2011/09/07 17:37:48, John Abd-El-Malek wrote: > On ...
9 years, 3 months ago (2011-09-07 18:50:14 UTC) #6
stevenjb
http://codereview.chromium.org/7779040/diff/11053/chrome/browser/browser_main.cc File chrome/browser/browser_main.cc (left): http://codereview.chromium.org/7779040/diff/11053/chrome/browser/browser_main.cc#oldcode2183 chrome/browser/browser_main.cc:2183: parts.reset(NULL); On 2011/09/07 17:10:31, satorux1 wrote: > The comment ...
9 years, 3 months ago (2011-09-07 22:27:55 UTC) #7
jam
9 years, 3 months ago (2011-09-08 00:33:56 UTC) #8
http://codereview.chromium.org/7779040/diff/11053/chrome/browser/browser_main.cc
File chrome/browser/browser_main.cc (left):

http://codereview.chromium.org/7779040/diff/11053/chrome/browser/browser_main...
chrome/browser/browser_main.cc:2183: parts.reset(NULL);
On 2011/09/07 22:27:55, Steven Bennetts wrote:
> On 2011/09/07 17:10:31, satorux1 wrote:
> > The comment says the BrowserMainParts is explicitly released, before
> > CrosLibrary's shutdown. However, CrosLibrary's shutdown is now moved to
> > ~BroserMainPartsChromeos. This is rather worrisome.
> > 
> > 
> >
>
http://codereview.chromium.org/7779040/diff/11053/chrome/browser/chromeos/bro...
> > 
> >  55 BrowserMainPartsChromeos::~BrowserMainPartsChromeos() {
> >  56   if (!parameters().ui_task && chromeos::CrosLibrary::Get())
> >  57     chromeos::CrosLibrary::Shutdown();
> 
> This definitely changes things. We need to change the comment, now at the
bottom
> of content/browser/browser_main.cc, as it is no longer accurate.

yep I have removed that in my next cl

> 
> Because the destructor of BrowserMainPartsChromeos and all of its member
> destructors occur before BrowserMainParts, we will not be able to shut down
> CrosLibrary before members of BrowserMainParts.

With my change CrosLibrary is shutdown before members of BrowserMainParts. The
only thing that depended on CrosLibrary is
BrowserMainParts::network_change_notifier_ since the factory is overriden by
BrowserMainPartsChromeos::PreMainMessageLoopStart(). We can add a method to
BrowserMainParts to reset the networkchangenotifier, but that did look hacky to
me, so instead I had made the networkchangenotifier handle the case of
CrosLibrary being gone. The only usage of it that I had seen was removing
observers, so it seemed ok to me, but you know this better than me.

http://codereview.chromium.org/7779040/diff/11053/chrome/browser/chromeos/net...
> 
> This means that we need to ensure that any class that has CrosLibrary calls in
> its destructor is shut down as part of BrowserMainPartsChromeos and not
> BrowserMainParts. This is more correct anyway.

Agreed.

> We will however need to do an audit before R15 goes to beta.

I suspect that if there were anymore, we'd quickly see this as shutdown crashes.

> 
> I am looking at a chromeos shutdown problem anyway so will try to make sure
that
> all of the auto tests, etc, get exercised in Debug mode and we catch any
> shutdown issues.
> 
>

Powered by Google App Engine
This is Rietveld 408576698