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.
5 #ifndef NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_
6 #define NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_
10 #include "base/basictypes.h"
11 #include "net/base/net_export.h"
12 #include "net/url_request/url_request_job_factory.h"
16 class NET_EXPORT URLRequestJobFactoryImpl
: public URLRequestJobFactory
{
18 URLRequestJobFactoryImpl();
19 virtual ~URLRequestJobFactoryImpl();
21 // URLRequestJobFactory implementation
22 virtual bool SetProtocolHandler(const std::string
& scheme
,
23 ProtocolHandler
* protocol_handler
) OVERRIDE
;
24 virtual void AddInterceptor(Interceptor
* interceptor
) OVERRIDE
;
25 virtual URLRequestJob
* MaybeCreateJobWithInterceptor(
26 URLRequest
* request
, NetworkDelegate
* network_delegate
) const OVERRIDE
;
27 virtual URLRequestJob
* MaybeCreateJobWithProtocolHandler(
28 const std::string
& scheme
,
30 NetworkDelegate
* network_delegate
) const OVERRIDE
;
31 virtual URLRequestJob
* MaybeInterceptRedirect(
34 NetworkDelegate
* network_delegate
) const OVERRIDE
;
35 virtual URLRequestJob
* MaybeInterceptResponse(
36 URLRequest
* request
, NetworkDelegate
* network_delegate
) const OVERRIDE
;
37 virtual bool IsHandledProtocol(const std::string
& scheme
) const OVERRIDE
;
38 virtual bool IsHandledURL(const GURL
& url
) const OVERRIDE
;
41 typedef std::map
<std::string
, ProtocolHandler
*> ProtocolHandlerMap
;
42 typedef std::vector
<Interceptor
*> InterceptorList
;
44 ProtocolHandlerMap protocol_handler_map_
;
45 InterceptorList interceptors_
;
47 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactoryImpl
);
52 #endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_