Chromium Code Reviews| Index: net/url_request/url_request_job_factory_impl.h |
| diff --git a/net/url_request/url_request_job_factory_impl.h b/net/url_request/url_request_job_factory_impl.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d8006b64757028a53ef6333695d05e52b1049ee6 |
| --- /dev/null |
| +++ b/net/url_request/url_request_job_factory_impl.h |
| @@ -0,0 +1,64 @@ |
| +// 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_URL_REQUEST_JOB_FACTORY_IMPL_H_ |
| +#define NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_ |
| + |
| +#include <map> |
| +#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.
|
| +#include <vector> |
| +#include "base/basictypes.h" |
| +#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.
|
| +#include "net/base/net_export.h" |
| +#include "net/url_request/url_request_job_factory.h" |
| + |
| +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.
|
| + |
| +namespace net { |
| + |
| +class URLRequest; |
| +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.
|
| + |
| +class NET_EXPORT URLRequestJobFactoryImpl : public URLRequestJobFactory { |
| + public: |
| + URLRequestJobFactoryImpl(); |
| + ~URLRequestJobFactoryImpl(); |
|
erikwright (departed)
2012/08/16 15:49:01
virtual
shalev
2012/08/16 18:40:39
Done.
|
| + |
| + // Sets the ProtocolHandler for a scheme. Returns true on success, false on |
| + // 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.
|
| + // URLRequestJobFactory takes ownership of |protocol_handler|. |
| + bool SetProtocolHandler(const std::string& scheme, |
| + ProtocolHandler* protocol_handler); |
| + |
| + // Takes ownership of |interceptor|. Adds it to the end of the Interceptor |
| + // list. |
| + void AddInterceptor(Interceptor* interceptor); |
| + |
| + URLRequestJob* MaybeCreateJobWithInterceptor(URLRequest* request) const; |
| + |
| + URLRequestJob* MaybeCreateJobWithProtocolHandler(const std::string& scheme, |
| + URLRequest* request) const; |
| + |
| + URLRequestJob* MaybeInterceptRedirect(const GURL& location, |
| + URLRequest* request) const; |
| + |
| + URLRequestJob* MaybeInterceptResponse(URLRequest* request) const; |
| + |
| + bool IsHandledProtocol(const std::string& scheme) const; |
| + |
| + bool IsHandledURL(const GURL& url) const; |
| + |
| + private: |
| + typedef std::map<std::string, ProtocolHandler*> ProtocolHandlerMap; |
| + typedef std::vector<Interceptor*> InterceptorList; |
| + |
| + ProtocolHandlerMap protocol_handler_map_; |
| + InterceptorList interceptors_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactoryImpl); |
| +}; |
| + |
| +} // namespace net |
| + |
| +#endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_ |