Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_ | |
| 6 #define NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 #include <string> | |
|
erikwright (departed)
2012/08/16 15:49:01
string is part of the interface you are implementi
shalev
2012/08/16 18:40:39
Done.
| |
| 10 #include <vector> | |
| 11 #include "base/basictypes.h" | |
| 12 #include "base/threading/non_thread_safe.h" | |
|
erikwright (departed)
2012/08/16 15:49:01
Don't need this any more.
shalev
2012/08/16 18:40:39
Done.
| |
| 13 #include "net/base/net_export.h" | |
| 14 #include "net/url_request/url_request_job_factory.h" | |
| 15 | |
| 16 class GURL; | |
|
erikwright (departed)
2012/08/16 15:49:01
part of the interface you are implementing, you ca
shalev
2012/08/16 18:40:39
Done.
| |
| 17 | |
| 18 namespace net { | |
| 19 | |
| 20 class URLRequest; | |
| 21 class URLRequestJob; | |
|
erikwright (departed)
2012/08/16 15:49:01
part of the interface you are implementing, you ca
shalev
2012/08/16 18:40:39
Done.
| |
| 22 | |
| 23 class NET_EXPORT URLRequestJobFactoryImpl : public URLRequestJobFactory { | |
| 24 public: | |
| 25 URLRequestJobFactoryImpl(); | |
| 26 ~URLRequestJobFactoryImpl(); | |
|
erikwright (departed)
2012/08/16 15:49:01
virtual
shalev
2012/08/16 18:40:39
Done.
| |
| 27 | |
| 28 // Sets the ProtocolHandler for a scheme. Returns true on success, false on | |
| 29 // failure (a ProtocolHandler already exists for |scheme|). On success, | |
|
erikwright (departed)
2012/08/16 15:49:01
Group under a comment:
// URLRequestJobFactory im
shalev
2012/08/16 18:40:39
Done.
| |
| 30 // URLRequestJobFactory takes ownership of |protocol_handler|. | |
| 31 bool SetProtocolHandler(const std::string& scheme, | |
| 32 ProtocolHandler* protocol_handler); | |
| 33 | |
| 34 // Takes ownership of |interceptor|. Adds it to the end of the Interceptor | |
| 35 // list. | |
| 36 void AddInterceptor(Interceptor* interceptor); | |
| 37 | |
| 38 URLRequestJob* MaybeCreateJobWithInterceptor(URLRequest* request) const; | |
| 39 | |
| 40 URLRequestJob* MaybeCreateJobWithProtocolHandler(const std::string& scheme, | |
| 41 URLRequest* request) const; | |
| 42 | |
| 43 URLRequestJob* MaybeInterceptRedirect(const GURL& location, | |
| 44 URLRequest* request) const; | |
| 45 | |
| 46 URLRequestJob* MaybeInterceptResponse(URLRequest* request) const; | |
| 47 | |
| 48 bool IsHandledProtocol(const std::string& scheme) const; | |
| 49 | |
| 50 bool IsHandledURL(const GURL& url) const; | |
| 51 | |
| 52 private: | |
| 53 typedef std::map<std::string, ProtocolHandler*> ProtocolHandlerMap; | |
| 54 typedef std::vector<Interceptor*> InterceptorList; | |
| 55 | |
| 56 ProtocolHandlerMap protocol_handler_map_; | |
| 57 InterceptorList interceptors_; | |
| 58 | |
| 59 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactoryImpl); | |
| 60 }; | |
| 61 | |
| 62 } // namespace net | |
| 63 | |
| 64 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_ | |
| OLD | NEW |