| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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 #import <Foundation/Foundation.h> |
| 6 |
| 7 #include "cronet_c_for_grpc.h" |
| 8 |
| 9 // Interface for installing Cronet. |
| 10 @interface Cronet : NSObject |
| 11 |
| 12 // Sets whether HTTP/2 should be supported by CronetEngine. This method only has |
| 13 // any effect before |start| is called. |
| 14 + (void)setHttp2Enabled:(BOOL)http2Enabled; |
| 15 |
| 16 // Sets whether QUIC should be supported by CronetEngine. This method only has |
| 17 // any effect before |start| is called. |
| 18 + (void)setQuicEnabled:(BOOL)quicEnabled; |
| 19 |
| 20 // Adds hint that host supports QUIC on altPort. This method only has any effect |
| 21 // before |start| is called. |
| 22 + (void)addQuicHint:(NSString*)host port:(int)port altPort:(int)altPort; |
| 23 |
| 24 // |userAgent| is expected to be of the form Product/Version. |
| 25 // Example: Foo/3.0.0.0 |
| 26 // |
| 27 // This method only has any effect before |start| is called. |
| 28 + (void)setPartialUserAgent:(NSString*)userAgent; |
| 29 |
| 30 // Sets SSLKEYLogFileName to export SSL key for Wireshark decryption of packet |
| 31 // captures. This method only has any effect before |start| is called. |
| 32 + (void)setSslKeyLogFileName:(NSString*)sslKeyLogFileName; |
| 33 |
| 34 // Starts CronetEngine. |
| 35 + (void)start; |
| 36 |
| 37 // Starts net-internals logging to a file named |fileName| in the application |
| 38 // temporary directory. |fileName| must not be empty. Log level is determined |
| 39 // by |logBytes| - if YES then LOG_ALL otherwise LOG_ALL_BUT_BYTES. If the file |
| 40 // exists it is truncated before starting. If actively logging the call is |
| 41 // ignored. |
| 42 + (void)startNetLogToFile:(NSString*)fileName logBytes:(BOOL)logBytes; |
| 43 |
| 44 // Stop net-internals logging and flush file to disk. If a logging session is |
| 45 // not in progress this call is ignored. |
| 46 + (void)stopNetLog; |
| 47 |
| 48 // Returns the full user-agent that the stack uses. |
| 49 // This is the exact string servers will see. |
| 50 + (NSString*)getUserAgent; |
| 51 |
| 52 // Get a pointer to global instance of cronet_engine for GRPC C API. |
| 53 + (cronet_engine*)getGlobalEngine; |
| 54 |
| 55 @end |
| OLD | NEW |