Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: ios/net/crn_http_protocol_handler.h

Issue 994823004: [iOS] Upstream //ios/net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2012 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 IOS_NET_CRN_HTTP_PROTOCOL_HANDLER_H_
6 #define IOS_NET_CRN_HTTP_PROTOCOL_HANDLER_H_
7
8 #import <Foundation/Foundation.h>
9
10 namespace net {
11 class URLRequestContextGetter;
12
13 class HTTPProtocolHandlerDelegate {
14 public:
15 // Sets the global instance of the HTTPProtocolHandlerDelegate.
16 static void SetInstance(HTTPProtocolHandlerDelegate* delegate);
17
18 virtual ~HTTPProtocolHandlerDelegate() {}
19
20 // Returns true if CRNHTTPProtocolHandler should handle the request.
21 // Returns false if the request should be passed down the NSURLProtocol chain.
22 virtual bool CanHandleRequest(NSURLRequest* request) = 0;
23
24 // If IsRequestSupported returns true, |request| will be processed, otherwise
25 // a NSURLErrorUnsupportedURL error is generated.
26 virtual bool IsRequestSupported(NSURLRequest* request) = 0;
27
28 // Returns the request context used for requests that are not associated with
29 // a RequestTracker. This includes in particular the requests that are not
30 // aware of the network stack. Must not return null.
31 virtual URLRequestContextGetter* GetDefaultURLRequestContext() = 0;
32 };
33
34 } // namespace net
35
36 // Custom NSURLProtocol handling HTTP and HTTPS requests.
37 // The HttpProtocolHandler is registered as a NSURLProtocol in the iOS system.
38 // This protocol is called for each NSURLRequest. This allows handling the
39 // requests issued by UIWebView using our own network stack.
40 @interface CRNHTTPProtocolHandler : NSURLProtocol
41 @end
42
43 #endif // IOS_NET_CRN_HTTP_PROTOCOL_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698