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

Unified Diff: net/url_request/url_fetcher_impl.h

Issue 10534154: Move URLFetcherImpl to net/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows link error 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 | « net/url_request/url_fetcher_core.h ('k') | net/url_request/url_fetcher_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_fetcher_impl.h
diff --git a/content/common/net/url_fetcher_impl.h b/net/url_request/url_fetcher_impl.h
similarity index 76%
rename from content/common/net/url_fetcher_impl.h
rename to net/url_request/url_fetcher_impl.h
index 6bc925045e15757d589d0e02e5e2435412ec2cf0..907669123829978022531d8ba036cba93b07133a 100644
--- a/content/common/net/url_fetcher_impl.h
+++ b/net/url_request/url_fetcher_impl.h
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// This file contains URLFetcher, a wrapper around net::URLRequest that handles
+// This file contains URLFetcher, a wrapper around URLRequest that handles
// low-level details like thread safety, ref counting, and incremental buffer
// reading. This is useful for callers who simply want to get the data from a
// URL and don't care about all the nitty-gritty details.
@@ -11,32 +11,32 @@
// temporary situation. We will work on allowing support for multiple "io"
// threads per process.
-#ifndef CONTENT_COMMON_NET_URL_FETCHER_IMPL_H_
-#define CONTENT_COMMON_NET_URL_FETCHER_IMPL_H_
+#ifndef NET_URL_REQUEST_URL_FETCHER_IMPL_H_
+#define NET_URL_REQUEST_URL_FETCHER_IMPL_H_
#pragma once
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "content/common/content_export.h"
-#include "content/public/common/url_fetcher.h"
+#include "net/base/net_export.h"
+#include "net/url_request/url_fetcher.h"
namespace net {
class URLFetcherCore;
class URLFetcherDelegate;
class URLFetcherFactory;
-} // namespace net
-class CONTENT_EXPORT URLFetcherImpl : public net::URLFetcher {
+// TODO(akalin): Remove NET_EXPORT once URLFetcher::Create is in net/.
+class NET_EXPORT URLFetcherImpl : public URLFetcher {
public:
// |url| is the URL to send the request to.
// |request_type| is the type of request to make.
// |d| the object that will receive the callback on fetch completion.
URLFetcherImpl(const GURL& url,
RequestType request_type,
- net::URLFetcherDelegate* d);
+ URLFetcherDelegate* d);
virtual ~URLFetcherImpl();
- // net::URLFetcher implementation:
+ // URLFetcher implementation:
virtual void SetUploadData(const std::string& upload_content_type,
const std::string& upload_content) OVERRIDE;
virtual void SetChunkedUpload(
@@ -50,9 +50,9 @@ class CONTENT_EXPORT URLFetcherImpl : public net::URLFetcher {
const std::string& extra_request_headers) OVERRIDE;
virtual void AddExtraRequestHeader(const std::string& header_line) OVERRIDE;
virtual void GetExtraRequestHeaders(
- net::HttpRequestHeaders* headers) const OVERRIDE;
+ HttpRequestHeaders* headers) const OVERRIDE;
virtual void SetRequestContext(
- net::URLRequestContextGetter* request_context_getter) OVERRIDE;
+ URLRequestContextGetter* request_context_getter) OVERRIDE;
virtual void SetFirstPartyForCookies(
const GURL& first_party_for_cookies) OVERRIDE;
virtual void SetURLRequestUserData(
@@ -68,15 +68,15 @@ class CONTENT_EXPORT URLFetcherImpl : public net::URLFetcher {
scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy) OVERRIDE;
virtual void SaveResponseToTemporaryFile(
scoped_refptr<base::MessageLoopProxy> file_message_loop_proxy) OVERRIDE;
- virtual net::HttpResponseHeaders* GetResponseHeaders() const OVERRIDE;
- virtual net::HostPortPair GetSocketAddress() const OVERRIDE;
+ virtual HttpResponseHeaders* GetResponseHeaders() const OVERRIDE;
+ virtual HostPortPair GetSocketAddress() const OVERRIDE;
virtual bool WasFetchedViaProxy() const OVERRIDE;
virtual void Start() OVERRIDE;
virtual const GURL& GetOriginalURL() const OVERRIDE;
virtual const GURL& GetURL() const OVERRIDE;
- virtual const net::URLRequestStatus& GetStatus() const OVERRIDE;
+ virtual const URLRequestStatus& GetStatus() const OVERRIDE;
virtual int GetResponseCode() const OVERRIDE;
- virtual const net::ResponseCookies& GetCookies() const OVERRIDE;
+ virtual const ResponseCookies& GetCookies() const OVERRIDE;
virtual bool FileErrorOccurred(
base::PlatformFileError* out_error_code) const OVERRIDE;
virtual void ReceivedContentWasMalformed() OVERRIDE;
@@ -88,31 +88,36 @@ class CONTENT_EXPORT URLFetcherImpl : public net::URLFetcher {
static void CancelAll();
+ static void SetEnableInterceptionForTests(bool enabled);
+
+ // TODO(akalin): Make these private again once URLFetcher::Create()
+ // is in net/.
+
+ static URLFetcherFactory* factory();
+
+ // Sets the factory used by the static method Create to create a URLFetcher.
+ // URLFetcher does not take ownership of |factory|. A value of NULL results
+ // in a URLFetcher being created directly.
+ //
+ // NOTE: for safety, this should only be used through ScopedURLFetcherFactory!
+ static void set_factory(URLFetcherFactory* factory);
+
protected:
// Returns the delegate.
- net::URLFetcherDelegate* delegate() const;
+ URLFetcherDelegate* delegate() const;
private:
- friend class ScopedURLFetcherFactory;
- friend class TestURLFetcher;
friend class URLFetcherTest;
// Only used by URLFetcherTest, returns the number of URLFetcher::Core objects
// actively running.
static int GetNumFetcherCores();
- static net::URLFetcherFactory* factory();
-
- // Sets the factory used by the static method Create to create a URLFetcher.
- // URLFetcher does not take ownership of |factory|. A value of NULL results
- // in a URLFetcher being created directly.
- //
- // NOTE: for safety, this should only be used through ScopedURLFetcherFactory!
- static void set_factory(net::URLFetcherFactory* factory);
-
- const scoped_refptr<net::URLFetcherCore> core_;
+ const scoped_refptr<URLFetcherCore> core_;
DISALLOW_COPY_AND_ASSIGN(URLFetcherImpl);
};
-#endif // CONTENT_COMMON_NET_URL_FETCHER_IMPL_H_
+} // namespace net
+
+#endif // NET_URL_REQUEST_URL_FETCHER_IMPL_H_
« no previous file with comments | « net/url_request/url_fetcher_core.h ('k') | net/url_request/url_fetcher_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698