1 // Copyright 2014 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_INTERCEPTOR_H_
6 #define NET_URL_REQUEST_URL_REQUEST_INTERCEPTOR_H_
8 #include "base/macros.h"
9 #include "net/base/net_export.h"
15 class NetworkDelegate
;
17 // A URLRequestInterceptor is given a chance to create a URLRequestJob to
18 // handle URLRequests before they're handed off to the ProtocolHandler for
19 // the request's scheme.
20 class NET_EXPORT URLRequestInterceptor
{
22 URLRequestInterceptor();
23 virtual ~URLRequestInterceptor();
25 // Returns a URLRequestJob to handle |request|, if the interceptor wants to
26 // take over the handling the request instead of the default ProtocolHandler.
27 // Otherwise, returns NULL.
28 virtual URLRequestJob
* MaybeInterceptRequest(
29 URLRequest
* request
, NetworkDelegate
* network_delegate
) const = 0;
32 DISALLOW_COPY_AND_ASSIGN(URLRequestInterceptor
);
37 #endif // NET_URL_REQUEST_URL_REQUEST_INTERCEPTOR_H_