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

Unified Diff: content/common/net/url_fetcher_impl.cc

Issue 10383271: Make AssociateWithRenderView() a free function in the 'content' namespace (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: actually rename fn Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/net/url_fetcher_impl.h ('k') | content/public/common/url_fetcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/net/url_fetcher_impl.cc
diff --git a/content/common/net/url_fetcher_impl.cc b/content/common/net/url_fetcher_impl.cc
index 35f7c5a80d030937dc7b174662aaa8c288450182..97449d364fa7b74d8b927889c7b3d1dc29cfa13d 100644
--- a/content/common/net/url_fetcher_impl.cc
+++ b/content/common/net/url_fetcher_impl.cc
@@ -40,6 +40,30 @@ void content::URLFetcher::SetEnableInterceptionForTests(bool enabled) {
URLFetcherCore::SetEnableInterceptionForTests(enabled);
}
+namespace {
+
+base::SupportsUserData::Data* CreateURLRequestUserData(
+ int render_process_id,
+ int render_view_id) {
+ return new URLRequestUserData(render_process_id, render_view_id);
+}
+
+} // namespace
+
+namespace content {
+
+void AssociateURLFetcherWithRenderView(net::URLFetcher* url_fetcher,
+ const GURL& first_party_for_cookies,
+ int render_process_id,
+ int render_view_id) {
+ url_fetcher->SetFirstPartyForCookies(first_party_for_cookies);
+ url_fetcher->SetURLRequestUserData(
+ URLRequestUserData::kUserDataKey,
+ base::Bind(&CreateURLRequestUserData,
+ render_process_id, render_view_id));
+}
+
+} // namespace content
URLFetcherImpl::URLFetcherImpl(const GURL& url,
RequestType request_type,
@@ -98,25 +122,15 @@ void URLFetcherImpl::SetRequestContext(
core_->SetRequestContext(request_context_getter);
}
-namespace {
-
-base::SupportsUserData::Data* CreateURLRequestUserData(
- int render_process_id,
- int render_view_id) {
- return new URLRequestUserData(render_process_id, render_view_id);
+void URLFetcherImpl::SetFirstPartyForCookies(
+ const GURL& first_party_for_cookies) {
+ core_->SetFirstPartyForCookies(first_party_for_cookies);
}
-} // namespace
-
-void URLFetcherImpl::AssociateWithRenderView(
- const GURL& first_party_for_cookies,
- int render_process_id,
- int render_view_id) {
- core_->SetFirstPartyForCookies(first_party_for_cookies);
- core_->SetURLRequestUserData(
- URLRequestUserData::kUserDataKey,
- base::Bind(&CreateURLRequestUserData,
- render_process_id, render_view_id));
+void URLFetcherImpl::SetURLRequestUserData(
+ const void* key,
+ const CreateDataCallback& create_data_callback) {
+ core_->SetURLRequestUserData(key, create_data_callback);
}
void URLFetcherImpl::SetAutomaticallyRetryOn5xx(bool retry) {
« no previous file with comments | « content/common/net/url_fetcher_impl.h ('k') | content/public/common/url_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698