Skip to content

Commit

Permalink
Moved URLRequestContextGetter to net/ so it can be used by projects s…
Browse files Browse the repository at this point in the history
…uch as jingle.

BUG=None
TEST=Build.
Review URL: http://codereview.chromium.org/6778025

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80033 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
sanjeevr@chromium.org committed Mar 31, 2011
1 parent 6cfef4d commit abe2c03
Show file tree
Hide file tree
Showing 145 changed files with 488 additions and 375 deletions.
2 changes: 1 addition & 1 deletion chrome/browser/autofill/autofill_download.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void AutofillDownloadManager::SetNegativeUploadRate(double rate) {
bool AutofillDownloadManager::StartRequest(
const std::string& form_xml,
const FormRequestData& request_data) {
URLRequestContextGetter* request_context =
net::URLRequestContextGetter* request_context =
Profile::GetDefaultRequestContext();
// Check if default request context is NULL: this very rarely happens,
// I think, this could happen only if user opens chrome with some pages
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/autofill/autofill_download_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class AutofillDownloadTestHelper : public AutofillDownloadManager::Observer {

TestingProfile profile;
AutofillDownloadManager download_manager;
scoped_refptr<URLRequestContextGetter> request_context_getter;
scoped_refptr<net::URLRequestContextGetter> request_context_getter;
};

typedef TestingBrowserProcessTest AutofillDownloadTest;
Expand Down
9 changes: 5 additions & 4 deletions chrome/browser/automation/automation_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
#include "chrome/common/chrome_version_info.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/json_value_serializer.h"
#include "chrome/common/net/url_request_context_getter.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/automation/tab_proxy.h"
Expand All @@ -97,6 +96,7 @@
#include "net/proxy/proxy_config_service_fixed.h"
#include "net/proxy/proxy_service.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "webkit/glue/password_form.h"

#if defined(OS_WIN)
Expand Down Expand Up @@ -546,7 +546,7 @@ void AutomationProvider::SendFindRequest(

class SetProxyConfigTask : public Task {
public:
SetProxyConfigTask(URLRequestContextGetter* request_context_getter,
SetProxyConfigTask(net::URLRequestContextGetter* request_context_getter,
const std::string& new_proxy_config)
: request_context_getter_(request_context_getter),
proxy_config_(new_proxy_config) {}
Expand Down Expand Up @@ -601,13 +601,14 @@ class SetProxyConfigTask : public Task {
}

private:
scoped_refptr<URLRequestContextGetter> request_context_getter_;
scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
std::string proxy_config_;
};


void AutomationProvider::SetProxyConfig(const std::string& new_proxy_config) {
URLRequestContextGetter* context_getter = Profile::GetDefaultRequestContext();
net::URLRequestContextGetter* context_getter =
Profile::GetDefaultRequestContext();
if (!context_getter) {
FilePath user_data_dir;
PathService::Get(chrome::DIR_USER_DATA, &user_data_dir);
Expand Down
24 changes: 12 additions & 12 deletions chrome/browser/automation/automation_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
#include "chrome/browser/renderer_host/browser_render_process_host.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/common/net/url_request_context_getter.h"
#include "chrome/browser/ui/browser.h"
#include "content/browser/browser_thread.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "net/base/cookie_monster.h"
#include "net/base/cookie_store.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"

namespace {

void GetCookiesOnIOThread(
const GURL& url,
const scoped_refptr<URLRequestContextGetter>& context_getter,
const scoped_refptr<net::URLRequestContextGetter>& context_getter,
base::WaitableEvent* event,
std::string* cookies) {
*cookies =
Expand All @@ -38,7 +38,7 @@ void GetCookiesOnIOThread(

void GetCanonicalCookiesOnIOThread(
const GURL& url,
const scoped_refptr<URLRequestContextGetter>& context_getter,
const scoped_refptr<net::URLRequestContextGetter>& context_getter,
base::WaitableEvent* event,
net::CookieList* cookie_list) {
*cookie_list =
Expand All @@ -50,7 +50,7 @@ void GetCanonicalCookiesOnIOThread(
void SetCookieOnIOThread(
const GURL& url,
const std::string& value,
const scoped_refptr<URLRequestContextGetter>& context_getter,
const scoped_refptr<net::URLRequestContextGetter>& context_getter,
base::WaitableEvent* event,
bool* success) {
*success =
Expand All @@ -63,7 +63,7 @@ void SetCookieWithDetailsOnIOThread(
const GURL& url,
const net::CookieMonster::CanonicalCookie& cookie,
const std::string& original_domain,
const scoped_refptr<URLRequestContextGetter>& context_getter,
const scoped_refptr<net::URLRequestContextGetter>& context_getter,
base::WaitableEvent* event,
bool* success) {
net::CookieMonster* cookie_monster =
Expand All @@ -79,7 +79,7 @@ void SetCookieWithDetailsOnIOThread(
void DeleteCookieOnIOThread(
const GURL& url,
const std::string& name,
const scoped_refptr<URLRequestContextGetter>& context_getter,
const scoped_refptr<net::URLRequestContextGetter>& context_getter,
base::WaitableEvent* event) {
context_getter->GetURLRequestContext()->cookie_store()->
DeleteCookie(url, name);
Expand Down Expand Up @@ -115,7 +115,7 @@ void GetCookies(const GURL& url,
// Get the request context specific to the current TabContents and app.
const Extension* installed_app = static_cast<BrowserRenderProcessHost*>(
contents->render_view_host()->process())->installed_app();
scoped_refptr<URLRequestContextGetter> context_getter =
scoped_refptr<net::URLRequestContextGetter> context_getter =
contents->profile()->GetRequestContextForPossibleApp(installed_app);

base::WaitableEvent event(true /* manual reset */,
Expand All @@ -141,7 +141,7 @@ void SetCookie(const GURL& url,
// Get the request context specific to the current TabContents and app.
const Extension* installed_app = static_cast<BrowserRenderProcessHost*>(
contents->render_view_host()->process())->installed_app();
scoped_refptr<URLRequestContextGetter> context_getter =
scoped_refptr<net::URLRequestContextGetter> context_getter =
contents->profile()->GetRequestContextForPossibleApp(installed_app);

base::WaitableEvent event(true /* manual reset */,
Expand All @@ -168,7 +168,7 @@ void DeleteCookie(const GURL& url,
// Get the request context specific to the current TabContents and app.
const Extension* installed_app = static_cast<BrowserRenderProcessHost*>(
contents->render_view_host()->process())->installed_app();
scoped_refptr<URLRequestContextGetter> context_getter =
scoped_refptr<net::URLRequestContextGetter> context_getter =
contents->profile()->GetRequestContextForPossibleApp(installed_app);

base::WaitableEvent event(true /* manual reset */,
Expand All @@ -193,7 +193,7 @@ void GetCookiesJSON(AutomationProvider* provider,
}

// Since we may be on the UI thread don't call GetURLRequestContext().
scoped_refptr<URLRequestContextGetter> context_getter =
scoped_refptr<net::URLRequestContextGetter> context_getter =
provider->profile()->GetRequestContext();

net::CookieList cookie_list;
Expand Down Expand Up @@ -242,7 +242,7 @@ void DeleteCookieJSON(AutomationProvider* provider,
}

// Since we may be on the UI thread don't call GetURLRequestContext().
scoped_refptr<URLRequestContextGetter> context_getter =
scoped_refptr<net::URLRequestContextGetter> context_getter =
provider->profile()->GetRequestContext();

base::WaitableEvent event(true /* manual reset */,
Expand Down Expand Up @@ -326,7 +326,7 @@ void SetCookieJSON(AutomationProvider* provider,
}

// Since we may be on the UI thread don't call GetURLRequestContext().
scoped_refptr<URLRequestContextGetter> context_getter =
scoped_refptr<net::URLRequestContextGetter> context_getter =
provider->profile()->GetRequestContext();

base::WaitableEvent event(true /* manual reset */,
Expand Down
7 changes: 5 additions & 2 deletions chrome/browser/browser_process.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ class ResourceDispatcherHost;
class SidebarManager;
class TabCloseableStateWatcher;
class ThumbnailGenerator;
class URLRequestContextGetter;
class WatchDogThread;

namespace base {
Expand All @@ -55,6 +54,10 @@ class ProxyConfigServiceImpl;
}
#endif // defined(OS_CHROMEOS)

namespace net {
class URLRequestContextGetter;
}

namespace printing {
class PrintJobManager;
class PrintPreviewTabController;
Expand Down Expand Up @@ -90,7 +93,7 @@ class BrowserProcess {
virtual DevToolsManager* devtools_manager() = 0;
virtual SidebarManager* sidebar_manager() = 0;
virtual ui::Clipboard* clipboard() = 0;
virtual URLRequestContextGetter* system_request_context() = 0;
virtual net::URLRequestContextGetter* system_request_context() = 0;

#if defined(OS_CHROMEOS)
// Returns ChromeOS's ProxyConfigServiceImpl, creating if not yet created.
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/browser_process_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
#include "chrome/common/extensions/extension_l10n_util.h"
#include "chrome/common/extensions/extension_resource.h"
#include "chrome/common/json_pref_store.h"
#include "chrome/common/net/url_request_context_getter.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/switch_utils.h"
#include "chrome/common/url_constants.h"
Expand All @@ -68,6 +67,7 @@
#include "content/browser/renderer_host/resource_dispatcher_host.h"
#include "content/common/notification_service.h"
#include "ipc/ipc_logging.h"
#include "net/url_request/url_request_context_getter.h"
#include "ui/base/clipboard/clipboard.h"
#include "ui/base/l10n/l10n_util.h"
#include "webkit/database/database_tracker.h"
Expand Down Expand Up @@ -461,7 +461,7 @@ ui::Clipboard* BrowserProcessImpl::clipboard() {
return clipboard_.get();
}

URLRequestContextGetter* BrowserProcessImpl::system_request_context() {
net::URLRequestContextGetter* BrowserProcessImpl::system_request_context() {
DCHECK(CalledOnValidThread());
return io_thread()->system_url_request_context_getter();
}
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/browser_process_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class BrowserProcessImpl : public BrowserProcess,
virtual DevToolsManager* devtools_manager();
virtual SidebarManager* sidebar_manager();
virtual ui::Clipboard* clipboard();
virtual URLRequestContextGetter* system_request_context();
virtual net::URLRequestContextGetter* system_request_context();
#if defined(OS_CHROMEOS)
virtual chromeos::ProxyConfigServiceImpl*
chromeos_proxy_config_service_impl();
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/browsing_data_appcache_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

#include "base/memory/scoped_ptr.h"
#include "base/task.h"
#include "chrome/common/net/url_request_context_getter.h"
#include "content/browser/appcache/chrome_appcache_service.h"
#include "googleurl/src/gurl.h"
#include "net/url_request/url_request_context_getter.h"

class Profile;

Expand Down Expand Up @@ -41,7 +41,7 @@ class BrowsingDataAppCacheHelper
void OnFetchComplete(int rv);
ChromeAppCacheService* GetAppCacheService();

scoped_refptr<URLRequestContextGetter> request_context_getter_;
scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
bool is_fetching_;
scoped_refptr<net::CancelableCompletionCallback<BrowsingDataAppCacheHelper> >
appcache_info_callback_;
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/browsing_data_remover.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "chrome/browser/sessions/session_service.h"
#include "chrome/browser/sessions/tab_restore_service.h"
#include "chrome/browser/webdata/web_data_service.h"
#include "chrome/common/net/url_request_context_getter.h"
#include "chrome/common/url_constants.h"
#include "content/browser/browser_thread.h"
#include "content/browser/in_process_webkit/webkit_context.h"
Expand All @@ -37,6 +36,7 @@
#include "net/disk_cache/disk_cache.h"
#include "net/http/http_cache.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "webkit/database/database_tracker.h"
#include "webkit/database/database_util.h"

Expand Down Expand Up @@ -386,7 +386,7 @@ void BrowsingDataRemover::DoClearCache(int rv) {
case STATE_CREATE_MAIN:
case STATE_CREATE_MEDIA: {
// Get a pointer to the cache.
URLRequestContextGetter* getter =
net::URLRequestContextGetter* getter =
(next_cache_state_ == STATE_CREATE_MAIN) ?
main_context_getter_ : media_context_getter_;
net::HttpTransactionFactory* factory =
Expand Down
9 changes: 6 additions & 3 deletions chrome/browser/browsing_data_remover.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ class ExtensionSpecialStoragePolicy;
class IOThread;
class PluginDataRemover;
class Profile;
class URLRequestContextGetter;

namespace disk_cache {
class Backend;
}

namespace net {
class URLRequestContextGetter;
}

namespace webkit_database {
class DatabaseTracker;
}
Expand Down Expand Up @@ -200,8 +203,8 @@ class BrowsingDataRemover : public NotificationObserver,
disk_cache::Backend* cache_;

// Used to delete data from HTTP cache and appcache.
scoped_refptr<URLRequestContextGetter> main_context_getter_;
scoped_refptr<URLRequestContextGetter> media_context_getter_;
scoped_refptr<net::URLRequestContextGetter> main_context_getter_;
scoped_refptr<net::URLRequestContextGetter> media_context_getter_;

// Used to delete plugin data.
scoped_refptr<PluginDataRemover> plugin_data_remover_;
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/chromeos/cros/libcros_service_library.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

Expand All @@ -7,12 +7,12 @@
#include "base/synchronization/lock.h"
#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/net/url_request_context_getter.h"
#include "content/browser/browser_thread.h"
#include "cros/chromeos_libcros_service.h"
#include "net/base/net_errors.h"
#include "net/proxy/proxy_service.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"

namespace chromeos {

Expand Down Expand Up @@ -208,7 +208,7 @@ void LibCrosServiceLibraryImpl::NetworkProxyLibrary::ResolveProxy(
&NetworkProxyLibrary::NotifyProxyResolved, request);

// Retrieve ProxyService from profile's request context.
URLRequestContextGetter* getter = Profile::GetDefaultRequestContext();
net::URLRequestContextGetter* getter = Profile::GetDefaultRequestContext();
net::ProxyService* proxy_service = NULL;
if (getter)
proxy_service = getter->GetURLRequestContext()->proxy_service();
Expand Down
8 changes: 5 additions & 3 deletions chrome/browser/chromeos/login/client_login_response_handler.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

Expand All @@ -11,7 +11,9 @@
#include "base/basictypes.h"
#include "chrome/browser/chromeos/login/auth_response_handler.h"

namespace net {
class URLRequestContextGetter;
}

namespace chromeos {

Expand All @@ -21,7 +23,7 @@ namespace chromeos {
// is then sent to the IssueAuthToken endpoint.
class ClientLoginResponseHandler : public AuthResponseHandler {
public:
explicit ClientLoginResponseHandler(URLRequestContextGetter* getter)
explicit ClientLoginResponseHandler(net::URLRequestContextGetter* getter)
: getter_(getter) {}
~ClientLoginResponseHandler() {}

Expand All @@ -43,7 +45,7 @@ class ClientLoginResponseHandler : public AuthResponseHandler {
static const char kService[];
private:
std::string payload_;
URLRequestContextGetter* getter_;
net::URLRequestContextGetter* getter_;

DISALLOW_COPY_AND_ASSIGN(ClientLoginResponseHandler);
};
Expand Down
Loading

0 comments on commit abe2c03

Please sign in to comment.