OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import <Foundation/Foundation.h> | 5 #import <Foundation/Foundation.h> |
6 | 6 |
7 #include "cronet_c_for_grpc.h" | 7 #include "cronet_c_for_grpc.h" |
8 | 8 |
9 // Interface for installing Cronet. | 9 // Interface for installing Cronet. |
10 CRONET_EXPORT | 10 CRONET_EXPORT |
(...skipping 14 matching lines...) Expand all Loading... |
25 // |userAgent| is expected to be of the form Product/Version. | 25 // |userAgent| is expected to be of the form Product/Version. |
26 // Example: Foo/3.0.0.0 | 26 // Example: Foo/3.0.0.0 |
27 // | 27 // |
28 // This method only has any effect before |start| is called. | 28 // This method only has any effect before |start| is called. |
29 + (void)setPartialUserAgent:(NSString*)userAgent; | 29 + (void)setPartialUserAgent:(NSString*)userAgent; |
30 | 30 |
31 // Sets SSLKEYLogFileName to export SSL key for Wireshark decryption of packet | 31 // Sets SSLKEYLogFileName to export SSL key for Wireshark decryption of packet |
32 // captures. This method only has any effect before |start| is called. | 32 // captures. This method only has any effect before |start| is called. |
33 + (void)setSslKeyLogFileName:(NSString*)sslKeyLogFileName; | 33 + (void)setSslKeyLogFileName:(NSString*)sslKeyLogFileName; |
34 | 34 |
35 // Starts CronetEngine. | 35 // Starts CronetEngine. It is recommended to call this method on the application |
| 36 // main thread. If the method is called on any thread other than the main one, |
| 37 // the method will internally try to execute synchronously using the main GCD |
| 38 // queue. Please make sure that the main thread is not blocked by a job |
| 39 // that calls this method; otherwise, a deadlock can occur. |
36 + (void)start; | 40 + (void)start; |
37 | 41 |
38 // Starts net-internals logging to a file named |fileName| in the application | 42 // Starts net-internals logging to a file named |fileName| in the application |
39 // temporary directory. |fileName| must not be empty. Log level is determined | 43 // temporary directory. |fileName| must not be empty. Log level is determined |
40 // by |logBytes| - if YES then LOG_ALL otherwise LOG_ALL_BUT_BYTES. If the file | 44 // by |logBytes| - if YES then LOG_ALL otherwise LOG_ALL_BUT_BYTES. If the file |
41 // exists it is truncated before starting. If actively logging the call is | 45 // exists it is truncated before starting. If actively logging the call is |
42 // ignored. | 46 // ignored. |
43 + (void)startNetLogToFile:(NSString*)fileName logBytes:(BOOL)logBytes; | 47 + (void)startNetLogToFile:(NSString*)fileName logBytes:(BOOL)logBytes; |
44 | 48 |
45 // Stop net-internals logging and flush file to disk. If a logging session is | 49 // Stop net-internals logging and flush file to disk. If a logging session is |
46 // not in progress this call is ignored. | 50 // not in progress this call is ignored. |
47 + (void)stopNetLog; | 51 + (void)stopNetLog; |
48 | 52 |
49 // Returns the full user-agent that the stack uses. | 53 // Returns the full user-agent that the stack uses. |
50 // This is the exact string servers will see. | 54 // This is the exact string servers will see. |
51 + (NSString*)getUserAgent; | 55 + (NSString*)getUserAgent; |
52 | 56 |
53 // Get a pointer to global instance of cronet_engine for GRPC C API. | 57 // Get a pointer to global instance of cronet_engine for GRPC C API. |
54 + (cronet_engine*)getGlobalEngine; | 58 + (cronet_engine*)getGlobalEngine; |
55 | 59 |
56 @end | 60 @end |
OLD | NEW |