Revert 117078 - 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
Some code (extensions+promos) used the fact that RDH is NULL in unittests as a signal to not use the utility process. I've switches those unittests to set a flag on the objects instead.
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
Review URL: http://codereview.chromium.org/9150016
[email protected]
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@117096 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index ce3abd1d..56946f2 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -2059,7 +2059,10 @@
// Notify observers.
FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidGetUserGesture());
- ResourceDispatcherHost::Get()->OnUserGesture(this);
+ ResourceDispatcherHost* rdh =
+ content::GetContentClient()->browser()->GetResourceDispatcherHost();
+ if (rdh) // NULL in unittests.
+ rdh->OnUserGesture(this);
}
void TabContents::OnIgnoredUIEvent() {