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

Issue 9150016: Move creation and ownership of ResourceDispatcherHost and PluginService to content. This gives a ... (Closed)

Created:
8 years, 11 months ago by jam
Modified:
8 years, 11 months ago
Reviewers:
Finnur, Jói
CC:
chromium-reviews, Avi (use Gerrit), creis+watch_chromium.org, tburkard+watch_chromium.org, yoshiki+watch_chromium.org, amit, ajwong+watch_chromium.org, jam, cbentzel+watch_chromium.org, dpranke-watch+content_chromium.org, joi+watch-content_chromium.org, Aaron Boodman, dominich+watch_chromium.org, darin-cc_chromium.org, rdsmith+dwatch_chromium.org, brettw-cc_chromium.org, robertshield, mihaip+watch_chromium.org, mmenke
Visibility:
Public.

Description

Move creation and ownership of ResourceDispatcherHost and PluginService to content. This gives a few benefits: -avoid having each embedder know when to create/destruct these objects, as well as contained objects (i.e. those related to downloads) -avoid having to tell embedders about specifics of BrowserThread startup/shutdown -move ResourceDispatcherHost's getter to content where it belongs I've taken out the DnsParallelism field trial (not used anymore, confirmed with jar) as it was the only thing that caused MetricsService to depend on IOThread initialization, which also depended on MetricsService (through FieldTrials). This two-sided dependency always annoyed me and made the code hard to restructure. BUG=98716 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=117078 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=117171

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : '' #

Patch Set 7 : '' #

Patch Set 8 : '' #

Total comments: 2

Patch Set 9 : sync #

Patch Set 10 : upload after revert #

Patch Set 11 : Create ResourceDispatcherHost expliclity in content + fix ChromeFrame #

Patch Set 12 : fix chromeos ui_tests #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+244 lines, -459 lines) Patch
M chrome/browser/DEPS View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/browser_process.h View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/browser_process_impl.h View 1 2 3 4 5 6 7 8 9 4 chunks +4 lines, -15 lines 0 comments Download
M chrome/browser/browser_process_impl.cc View 1 2 3 4 5 6 7 8 9 10 chunks +45 lines, -122 lines 0 comments Download
M chrome/browser/chrome_browser_main.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/chrome_browser_main.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +20 lines, -46 lines 1 comment Download
M chrome/browser/chrome_content_browser_client.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/download/download_browsertest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +3 lines, -5 lines 0 comments Download
M chrome/browser/download/download_extension_api.cc View 1 2 3 4 5 6 7 8 9 2 chunks +1 line, -2 lines 0 comments Download
M chrome/browser/download/download_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/download/download_service.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/download/download_throttling_resource_handler.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/extensions/crx_installer.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_service.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -4 lines 0 comments Download
M chrome/browser/extensions/extension_updater.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -1 line 0 comments Download
M chrome/browser/io_thread.cc View 1 2 3 4 5 6 7 8 9 2 chunks +0 lines, -38 lines 0 comments Download
M chrome/browser/prerender/prerender_tracker.cc View 1 2 3 4 5 6 7 8 9 2 chunks +6 lines, -15 lines 0 comments Download
M chrome/browser/profiles/profile_io_data.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/task_manager/task_manager_resource_providers.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/web_resource/web_resource_service.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -1 line 0 comments Download
M chrome/test/base/testing_browser_process.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/base/testing_browser_process.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -3 lines 0 comments Download
M chrome_frame/test/net/fake_external_tab.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -5 lines 0 comments Download
M chrome_frame/test/net/fake_external_tab.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -18 lines 0 comments Download
M content/browser/browser_main_loop.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +7 lines, -0 lines 0 comments Download
M content/browser/browser_main_loop.cc View 1 2 3 4 5 6 7 8 9 10 9 chunks +33 lines, -12 lines 0 comments Download
M content/browser/download/download_manager_impl.h View 1 2 3 4 5 6 7 8 9 2 chunks +1 line, -2 lines 0 comments Download
M content/browser/download/download_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +14 lines, -3 lines 0 comments Download
M content/browser/download/save_package.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/mock_content_browser_client.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M content/browser/mock_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/plugin_process_host.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M content/browser/plugin_process_host.cc View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -2 lines 0 comments Download
M content/browser/plugin_service_impl.h View 1 2 3 4 5 6 7 8 9 2 chunks +0 lines, -6 lines 0 comments Download
M content/browser/plugin_service_impl.cc View 1 2 3 4 5 6 7 8 9 3 chunks +2 lines, -9 lines 0 comments Download
M content/browser/renderer_host/render_message_filter.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -3 lines 0 comments Download
M content/browser/renderer_host/render_message_filter.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -5 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +11 lines, -3 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +28 lines, -10 lines 0 comments Download
M content/browser/renderer_host/resource_dispatcher_host_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +1 line, -3 lines 0 comments Download
M content/browser/renderer_host/resource_message_filter.h View 1 2 3 4 5 6 7 8 9 3 chunks +5 lines, -10 lines 0 comments Download
M content/browser/renderer_host/resource_message_filter.cc View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -6 lines 0 comments Download
M content/browser/tab_contents/interstitial_page.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -4 lines 0 comments Download
M content/browser/tab_contents/tab_contents.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -2 lines 0 comments Download
M content/browser/worker_host/worker_message_filter.h View 1 2 3 4 5 6 7 8 9 3 chunks +0 lines, -5 lines 0 comments Download
M content/browser/worker_host/worker_message_filter.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -2 lines 0 comments Download
M content/browser/worker_host/worker_process_host.h View 1 2 3 4 5 6 7 8 9 3 chunks +1 line, -7 lines 0 comments Download
M content/browser/worker_host/worker_process_host.cc View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -7 lines 0 comments Download
M content/browser/worker_host/worker_service_impl.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -3 lines 0 comments Download
M content/public/browser/browser_main_parts.h View 1 2 3 4 5 6 7 8 9 2 chunks +0 lines, -17 lines 0 comments Download
M content/public/browser/browser_shutdown.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -2 lines 0 comments Download
M content/public/browser/content_browser_client.h View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -1 line 0 comments Download
M content/public/browser/download_manager.h View 1 2 3 4 5 6 7 8 9 2 chunks +7 lines, -0 lines 0 comments Download
M content/shell/shell_browser_main.h View 1 2 3 4 5 6 7 8 9 2 chunks +0 lines, -8 lines 0 comments Download
M content/shell/shell_browser_main.cc View 1 2 3 4 5 6 7 8 9 3 chunks +0 lines, -22 lines 0 comments Download
M content/shell/shell_content_browser_client.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M content/shell/shell_content_browser_client.cc View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
jam
8 years, 11 months ago (2012-01-10 00:37:47 UTC) #1
Jói
LGTM, very nice, great to see BrowserMainParts become simpler again. Cheers, Jói http://codereview.chromium.org/9150016/diff/10121/content/browser/renderer_host/resource_dispatcher_host.cc File content/browser/renderer_host/resource_dispatcher_host.cc ...
8 years, 11 months ago (2012-01-10 10:58:57 UTC) #2
jam
http://codereview.chromium.org/9150016/diff/10121/content/browser/renderer_host/resource_dispatcher_host.cc File content/browser/renderer_host/resource_dispatcher_host.cc (right): http://codereview.chromium.org/9150016/diff/10121/content/browser/renderer_host/resource_dispatcher_host.cc#newcode301 content/browser/renderer_host/resource_dispatcher_host.cc:301: g_resource_dispatcher_host = new ResourceDispatcherHost(); On 2012/01/10 10:58:57, Jói wrote: ...
8 years, 11 months ago (2012-01-10 17:34:08 UTC) #3
Jói
LGTM On Tue, Jan 10, 2012 at 5:34 PM, <jam@chromium.org> wrote: > > http://codereview.chromium.org/9150016/diff/10121/content/browser/renderer_host/resource_dispatcher_host.cc > ...
8 years, 11 months ago (2012-01-10 18:30:40 UTC) #4
jam
This patch got reverted. I've uploaded the reverted version as ps10. I gave up on ...
8 years, 11 months ago (2012-01-11 00:58:06 UTC) #5
Jói
Latest patchset LGTM
8 years, 11 months ago (2012-01-11 10:32:34 UTC) #6
Finnur
http://codereview.chromium.org/9150016/diff/11168/chrome/browser/chrome_browser_main.cc File chrome/browser/chrome_browser_main.cc (right): http://codereview.chromium.org/9150016/diff/11168/chrome/browser/chrome_browser_main.cc#newcode1313 chrome/browser/chrome_browser_main.cc:1313: browser_process_->PreCreateThreads(); I believe this CL caused a crasher in ...
8 years, 11 months ago (2012-01-18 17:11:06 UTC) #7
jam
thanks for the repro, i'll take a look On Wed, Jan 18, 2012 at 9:11 ...
8 years, 11 months ago (2012-01-18 17:31:47 UTC) #8
Jói
8 years, 11 months ago (2012-01-18 17:32:00 UTC) #9
What does the crash look like, is somebody using IOThread after we
return from the function?  It might be reasonable to just set the
desired return value and return at the end after more initialization
has been done, if that initialization is required.

Cheers,
Jói


On Wed, Jan 18, 2012 at 5:11 PM,  <finnur@chromium.org> wrote:
>
>
http://codereview.chromium.org/9150016/diff/11168/chrome/browser/chrome_brows...
> File chrome/browser/chrome_browser_main.cc (right):
>
>
http://codereview.chromium.org/9150016/diff/11168/chrome/browser/chrome_brows...
> chrome/browser/chrome_browser_main.cc:1313:
> browser_process_->PreCreateThreads();
> I believe this CL caused a crasher in the toast code due to early return
> around lines 1223 above.
>
> Run chrome.exe with --try-chrome-again=10001 and Chrome will... KABOOM!
>
> A cursory glance revealed that io_thread_ (normally created as a result
> of PreCreateThreads) is not created and so it crashes when it is first
> used (safebrowsing in my case).
>
> I'm writing a test to catch this in the future, but we need to figure
> out what to do with the crash before I can enable it.
>
> http://codereview.chromium.org/9150016/

Powered by Google App Engine
This is Rietveld 408576698