diff options
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/DEPS | 5 | ||||
-rw-r--r-- | content/browser/content_browser_client.h | 6 | ||||
-rw-r--r-- | content/browser/geolocation/arbitrator_dependency_factory.cc | 7 | ||||
-rw-r--r-- | content/browser/mock_content_browser_client.cc | 5 | ||||
-rw-r--r-- | content/browser/mock_content_browser_client.h | 2 | ||||
-rw-r--r-- | content/browser/resolve_proxy_msg_helper.cc | 14 | ||||
-rw-r--r-- | content/browser/speech/speech_recognizer.cc | 10 |
7 files changed, 36 insertions, 13 deletions
diff --git a/content/browser/DEPS b/content/browser/DEPS index 4623a01..a2ab4d2 100644 --- a/content/browser/DEPS +++ b/content/browser/DEPS @@ -4,12 +4,9 @@ include_rules = [ # Listing of the remaining #chrome includes in content\browser. People are # actively working on reducing this to 0. # DO NOT ADD ANY MORE TO THIS LIST!!! - # See https://sites.google.com/a/chromium.org/dev/developers/content-module + # See http://dev.chromium.org/developers/content-module # for more information. - # http://crbug.com/76788 - "+chrome/browser/profiles/profile.h", - # ONLY USED BY TESTS "+chrome/browser/ui/browser.h", diff --git a/content/browser/content_browser_client.h b/content/browser/content_browser_client.h index 9eee934..961beca 100644 --- a/content/browser/content_browser_client.h +++ b/content/browser/content_browser_client.h @@ -42,6 +42,7 @@ class CookieOptions; class NetLog; class URLRequest; class URLRequestContext; +class URLRequestContextGetter; class X509Certificate; } @@ -269,6 +270,11 @@ class ContentBrowserClient { // This can be called on any thread. virtual FilePath GetDefaultDownloadDirectory() = 0; + // Returns the "default" request context. There is no such thing in the world + // of multiple profiles, and all calls to this need to be removed. + virtual net::URLRequestContextGetter* + GetDefaultRequestContextDeprecatedCrBug64339() = 0; + #if defined(OS_POSIX) && !defined(OS_MACOSX) // Can return an optional fd for crash handling, otherwise returns -1. virtual int GetCrashSignalFD(const std::string& process_type) = 0; diff --git a/content/browser/geolocation/arbitrator_dependency_factory.cc b/content/browser/geolocation/arbitrator_dependency_factory.cc index 547227a..ada618d 100644 --- a/content/browser/geolocation/arbitrator_dependency_factory.cc +++ b/content/browser/geolocation/arbitrator_dependency_factory.cc @@ -4,9 +4,10 @@ #include "content/browser/geolocation/arbitrator_dependency_factory.h" -#include "chrome/browser/profiles/profile.h" +#include "content/browser/content_browser_client.h" #include "content/browser/geolocation/access_token_store.h" #include "content/browser/geolocation/location_provider.h" +#include "content/common/content_client.h" // GeolocationArbitratorDependencyFactory GeolocationArbitratorDependencyFactory:: @@ -16,7 +17,9 @@ GeolocationArbitratorDependencyFactory:: // DefaultGeolocationArbitratorDependencyFactory net::URLRequestContextGetter* DefaultGeolocationArbitratorDependencyFactory::GetContextGetter() { - return Profile::Deprecated::GetDefaultRequestContext(); + // Deprecated; see http://crbug.com/92363 + return content::GetContentClient()->browser()-> + GetDefaultRequestContextDeprecatedCrBug64339(); } DefaultGeolocationArbitratorDependencyFactory::GetTimeNow diff --git a/content/browser/mock_content_browser_client.cc b/content/browser/mock_content_browser_client.cc index c1115e1..80a104b 100644 --- a/content/browser/mock_content_browser_client.cc +++ b/content/browser/mock_content_browser_client.cc @@ -227,6 +227,11 @@ FilePath MockContentBrowserClient::GetDefaultDownloadDirectory() { return FilePath(); } +net::URLRequestContextGetter* +MockContentBrowserClient::GetDefaultRequestContextDeprecatedCrBug64339() { + return NULL; +} + #if defined(OS_POSIX) && !defined(OS_MACOSX) int MockContentBrowserClient::GetCrashSignalFD( const std::string& process_type) { diff --git a/content/browser/mock_content_browser_client.h b/content/browser/mock_content_browser_client.h index 0c16ce7..0779365 100644 --- a/content/browser/mock_content_browser_client.h +++ b/content/browser/mock_content_browser_client.h @@ -109,6 +109,8 @@ class MockContentBrowserClient : public ContentBrowserClient { virtual void ClearCache(RenderViewHost* rvh) OVERRIDE; virtual void ClearCookies(RenderViewHost* rvh) OVERRIDE; virtual FilePath GetDefaultDownloadDirectory() OVERRIDE; + virtual net::URLRequestContextGetter* + GetDefaultRequestContextDeprecatedCrBug64339() OVERRIDE; #if defined(OS_POSIX) && !defined(OS_MACOSX) virtual int GetCrashSignalFD(const std::string& process_type) OVERRIDE; diff --git a/content/browser/resolve_proxy_msg_helper.cc b/content/browser/resolve_proxy_msg_helper.cc index 80ab29b..b539b57 100644 --- a/content/browser/resolve_proxy_msg_helper.cc +++ b/content/browser/resolve_proxy_msg_helper.cc @@ -5,8 +5,9 @@ #include "content/browser/resolve_proxy_msg_helper.h" #include "base/compiler_specific.h" -#include "chrome/browser/profiles/profile.h" +#include "content/browser/content_browser_client.h" #include "content/common/child_process_messages.h" +#include "content/common/content_client.h" #include "net/base/net_errors.h" #include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context_getter.h" @@ -90,8 +91,10 @@ bool ResolveProxyMsgHelper::GetProxyService(net::ProxyService** out) const { } // If there is no default request context (say during shut down). + // Deprecated; see http://crbug.com/92361 net::URLRequestContextGetter* context_getter = - Profile::Deprecated::GetDefaultRequestContext(); + content::GetContentClient()->browser()-> + GetDefaultRequestContextDeprecatedCrBug64339(); if (!context_getter) return false; @@ -103,9 +106,12 @@ bool ResolveProxyMsgHelper::GetProxyService(net::ProxyService** out) const { ResolveProxyMsgHelper::~ResolveProxyMsgHelper() { // Clear all pending requests if the ProxyService is still alive (if we have a // default request context or override). + // Deprecated; see http://crbug.com/92361 + net::URLRequestContextGetter* context_getter = + content::GetContentClient()->browser()-> + GetDefaultRequestContextDeprecatedCrBug64339(); if (!pending_requests_.empty() && - (Profile::Deprecated::GetDefaultRequestContext() || - proxy_service_override_)) { + (context_getter || proxy_service_override_)) { PendingRequest req = pending_requests_.front(); proxy_service_->CancelPacRequest(req.pac_req); } diff --git a/content/browser/speech/speech_recognizer.cc b/content/browser/speech/speech_recognizer.cc index e6d32ee..f6019f6 100644 --- a/content/browser/speech/speech_recognizer.cc +++ b/content/browser/speech/speech_recognizer.cc @@ -5,8 +5,9 @@ #include "content/browser/speech/speech_recognizer.h" #include "base/time.h" -#include "chrome/browser/profiles/profile.h" #include "content/browser/browser_thread.h" +#include "content/browser/content_browser_client.h" +#include "content/common/content_client.h" #include "net/url_request/url_request_context_getter.h" using media::AudioInputController; @@ -223,8 +224,11 @@ void SpeechRecognizer::HandleOnData(string* data) { // This was the first audio packet recorded, so start a request to the // server to send the data and inform the delegate. delegate_->DidStartReceivingAudio(caller_id_); - request_.reset(new SpeechRecognitionRequest( - Profile::Deprecated::GetDefaultRequestContext(), this)); + // Deprecated; see http://crbug.com/92366 + net::URLRequestContextGetter* context_getter = + content::GetContentClient()->browser()-> + GetDefaultRequestContextDeprecatedCrBug64339(); + request_.reset(new SpeechRecognitionRequest(context_getter, this)); request_->Start(language_, grammar_, censor_results_, hardware_info_, origin_url_, encoder_->mime_type()); } |