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

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

Issue 10534154: Move URLFetcherImpl to net/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix checkdeps Created 8 years, 6 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 | « no previous file | content/common/net/url_fetcher_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/net/url_fetcher.cc
diff --git a/content/common/net/url_fetcher.cc b/content/common/net/url_fetcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b15305689fea99f78467ebf7e57ba740e2eaf2b0
--- /dev/null
+++ b/content/common/net/url_fetcher.cc
@@ -0,0 +1,65 @@
+// Copyright (c) 2012 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.
+
+#include "content/public/common/url_fetcher.h"
+
+#include "base/bind.h"
+#include "content/common/net/url_request_user_data.h"
+#include "net/url_request/url_fetcher_core.h"
+#include "net/url_request/url_fetcher_factory.h"
+#include "net/url_request/url_fetcher_impl.h"
+
+// static
+net::URLFetcher* content::URLFetcher::Create(
+ const GURL& url,
+ net::URLFetcher::RequestType request_type,
+ net::URLFetcherDelegate* d) {
+ return new net::URLFetcherImpl(url, request_type, d);
+}
+
+// static
+net::URLFetcher* content::URLFetcher::Create(
+ int id,
+ const GURL& url,
+ net::URLFetcher::RequestType request_type,
+ net::URLFetcherDelegate* d) {
+ net::URLFetcherFactory* const factory = net::URLFetcherImpl::factory();
wtc 2012/06/14 19:52:28 Nit: the use of 'const' here seems a little excess
akalin 2012/06/15 03:42:16 Done.
+ return factory ? factory->CreateURLFetcher(id, url, request_type, d) :
+ new net::URLFetcherImpl(url, request_type, d);
+}
+
+// static
+void content::URLFetcher::CancelAll() {
+ net::URLFetcherImpl::CancelAll();
+}
+
+// static
+void content::URLFetcher::SetEnableInterceptionForTests(bool enabled) {
+ net::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
« no previous file with comments | « no previous file | content/common/net/url_fetcher_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698