OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "crnet_consumer_app_delegate.h" | 5 #import "crnet_consumer_app_delegate.h" |
6 | 6 |
7 #import "CrNet.h" | 7 #import "CrNet.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #import "crnet_consumer_view_controller.h" | 9 #import "crnet_consumer_view_controller.h" |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 withIntermediateDirectories:YES | 38 withIntermediateDirectories:YES |
39 attributes:nil | 39 attributes:nil |
40 error:&error]; | 40 error:&error]; |
41 return error != nil ? [prefStoreFile path] : nil; | 41 return error != nil ? [prefStoreFile path] : nil; |
42 } | 42 } |
43 | 43 |
44 - (BOOL)application:(UIApplication*)application | 44 - (BOOL)application:(UIApplication*)application |
45 didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { | 45 didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { |
46 [CrNet setPartialUserAgent:@"Dummy/1.0"]; | 46 [CrNet setPartialUserAgent:@"Dummy/1.0"]; |
47 [CrNet setQuicEnabled:YES]; | 47 [CrNet setQuicEnabled:YES]; |
| 48 // Always use QUIC if able. |
| 49 [CrNet setAlternateProtocolThreshold:0.0]; |
48 [CrNet setSDCHEnabled:YES withPrefStore:[self SDCHPrefStoreFileName]]; | 50 [CrNet setSDCHEnabled:YES withPrefStore:[self SDCHPrefStoreFileName]]; |
49 [CrNet install]; | 51 [CrNet install]; |
50 [CrNet startNetLogToFile:[self currentNetLogFileName] logBytes:NO]; | 52 [CrNet startNetLogToFile:[self currentNetLogFileName] logBytes:NO]; |
51 | 53 |
52 NSURLSessionConfiguration* config = | 54 NSURLSessionConfiguration* config = |
53 [NSURLSessionConfiguration ephemeralSessionConfiguration]; | 55 [NSURLSessionConfiguration ephemeralSessionConfiguration]; |
54 [CrNet installIntoSessionConfiguration:config]; | 56 [CrNet installIntoSessionConfiguration:config]; |
55 | 57 |
56 // Just for fun, don't route chromium.org requests through CrNet. | 58 // Just for fun, don't route chromium.org requests through CrNet. |
57 // | 59 // |
(...skipping 22 matching lines...) Expand all Loading... |
80 NSLog(@"Cache cleared: %d\n", error); | 82 NSLog(@"Cache cleared: %d\n", error); |
81 }]; | 83 }]; |
82 } | 84 } |
83 | 85 |
84 - (void)applicationWillEnterForeground:(UIApplication*)application { | 86 - (void)applicationWillEnterForeground:(UIApplication*)application { |
85 _counter++; | 87 _counter++; |
86 [CrNet startNetLogToFile:[self currentNetLogFileName] logBytes:NO]; | 88 [CrNet startNetLogToFile:[self currentNetLogFileName] logBytes:NO]; |
87 } | 89 } |
88 | 90 |
89 @end | 91 @end |
OLD | NEW |