url_request_job_factory_impl.h revision 5821806d5e7f356e8fa4b058a389a808ea183019
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 <vector> 10#include "base/basictypes.h" 11#include "net/base/net_export.h" 12#include "net/url_request/url_request_job_factory.h" 13 14namespace net { 15 16class NET_EXPORT URLRequestJobFactoryImpl : public URLRequestJobFactory { 17 public: 18 URLRequestJobFactoryImpl(); 19 virtual ~URLRequestJobFactoryImpl(); 20 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, 29 URLRequest* request, 30 NetworkDelegate* network_delegate) const OVERRIDE; 31 virtual URLRequestJob* MaybeInterceptRedirect( 32 const GURL& location, 33 URLRequest* request, 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; 39 40 private: 41 typedef std::map<std::string, ProtocolHandler*> ProtocolHandlerMap; 42 typedef std::vector<Interceptor*> InterceptorList; 43 44 ProtocolHandlerMap protocol_handler_map_; 45 InterceptorList interceptors_; 46 47 DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactoryImpl); 48}; 49 50} // namespace net 51 52#endif // NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_IMPL_H_ 53