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

Unified Diff: net/url_request/http_intercept_job_factory.h

Issue 10836248: Turned job_factory into a pure virtual class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up, responded to suggestions Created 8 years, 4 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
Index: net/url_request/http_intercept_job_factory.h
diff --git a/net/url_request/http_intercept_job_factory.h b/net/url_request/http_intercept_job_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..5be029867af9b9187e551d44a5cf3909c10ab3c4
--- /dev/null
+++ b/net/url_request/http_intercept_job_factory.h
@@ -0,0 +1,59 @@
+// 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.
+
+#ifndef NET_URL_REQUEST_HTTP_INTERCEPT_JOB_FACTORY_H_
+#define NET_URL_REQUEST_HTTP_INTERCEPT_JOB_FACTORY_H_
+
+#include "base/basictypes.h"
mmenke 2012/08/16 19:12:11 #include "base/compiler_specific.h" for OVERRIDE,
shalev 2012/08/22 19:10:11 Done.
+#include "net/base/net_export.h"
+#include "net/url_request/url_request_job_factory.h"
+
+class GURL;
+
+namespace net {
+
+class URLRequest;
+class URLRequestJob;
+
+// This class acts as a wrapper for URLRequestJobFactory. It handles http and
+// https jobs using |protocol_handler_|, but forwards all other schemes to the
+// old job factory to be handled there.
+class NET_EXPORT HttpInterceptJobFactory : public URLRequestJobFactory {
+ public:
+ HttpInterceptJobFactory(const URLRequestJobFactory* job_factory,
+ ProtocolHandler* protocol_handler);
+ ~HttpInterceptJobFactory();
mmenke 2012/08/16 19:12:11 Destructor should be virtual
shalev 2012/08/22 19:10:11 Done.
+
+ // URLRequestJobFactory implementation
+
+ bool SetProtocolHandler(const std::string& scheme,
willchan no longer on Chromium 2012/08/16 20:35:37 Everything that is overridden should include "virt
shalev 2012/08/22 19:10:11 Done.
+ ProtocolHandler* protocol_handler) OVERRIDE;
+
+ void AddInterceptor(Interceptor* interceptor) OVERRIDE;
+
+ URLRequestJob* MaybeCreateJobWithInterceptor(
+ URLRequest* request) const OVERRIDE;
+
+ URLRequestJob* MaybeCreateJobWithProtocolHandler(
+ const std::string& scheme, URLRequest* request) const OVERRIDE;
+
+ URLRequestJob* MaybeInterceptRedirect(
+ const GURL& location, URLRequest* request) const OVERRIDE;
+
+ URLRequestJob* MaybeInterceptResponse(URLRequest* request) const OVERRIDE;
+
+ bool IsHandledProtocol(const std::string& scheme) const OVERRIDE;
+
+ bool IsHandledURL(const GURL& url) const OVERRIDE;
mmenke 2012/08/16 19:12:11 These should all be virtual
shalev 2012/08/22 19:10:11 Done.
+
+ private:
+ const URLRequestJobFactory* job_factory_;
+ ProtocolHandler* protocol_handler_;
+
+ DISALLOW_COPY_AND_ASSIGN(HttpInterceptJobFactory);
+};
+
+} // namespace net
+
+#endif // NET_URL_REQUEST_HTTP_INTERCEPT_JOB_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698