Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ios / web / net / clients / crw_passkit_network_client.h
blob3a6738ae3d4439d466bdf6df9ae2ac795ba849ae
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.
5 #ifndef IOS_WEB_NET_CLIENTS_CRW_PASSKIT_NETWORK_CLIENT_H_
6 #define IOS_WEB_NET_CLIENTS_CRW_PASSKIT_NETWORK_CLIENT_H_
8 #import <Foundation/Foundation.h>
10 #include "base/memory/weak_ptr.h"
11 #import "ios/net/clients/crn_forwarding_network_client.h"
13 namespace net {
14 class RequestTracker;
17 @protocol CRWPassKitDelegate;
19 // The CRWPassKitNetworkClient intercepts data from the network stack, caches it
20 // as it is read from the network, and on completion asks the delegate to
21 // handle the complete object.
22 // The CRWPassKitNetworkClient is inserted into the HttpProtocolHandlerCore's
23 // clients list when it detects that a PassKit object is being downloaded.
24 @interface CRWPassKitNetworkClient : CRNForwardingNetworkClient
26 // Designated initializer. This class assumes that |delegate| in not nil and
27 // will remain alive for the duration of the request this client is handling.
28 - (instancetype)initWithTracker:(base::WeakPtr<net::RequestTracker>)tracker
29 delegate:(id<CRWPassKitDelegate>)delegate;
31 @end
33 #endif // IOS_WEB_NET_CLIENTS_CRW_PASSKIT_NETWORK_CLIENT_H_