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]; | |
50 [CrNet setSDCHEnabled:YES withPrefStore:[self SDCHPrefStoreFileName]]; | 48 [CrNet setSDCHEnabled:YES withPrefStore:[self SDCHPrefStoreFileName]]; |
51 [CrNet install]; | 49 [CrNet install]; |
52 [CrNet startNetLogToFile:[self currentNetLogFileName] logBytes:NO]; | 50 [CrNet startNetLogToFile:[self currentNetLogFileName] logBytes:NO]; |
53 | 51 |
54 NSURLSessionConfiguration* config = | 52 NSURLSessionConfiguration* config = |
55 [NSURLSessionConfiguration ephemeralSessionConfiguration]; | 53 [NSURLSessionConfiguration ephemeralSessionConfiguration]; |
56 [CrNet installIntoSessionConfiguration:config]; | 54 [CrNet installIntoSessionConfiguration:config]; |
57 | 55 |
58 // Just for fun, don't route chromium.org requests through CrNet. | 56 // Just for fun, don't route chromium.org requests through CrNet. |
59 // | 57 // |
(...skipping 22 matching lines...) Expand all Loading... |
82 NSLog(@"Cache cleared: %d\n", error); | 80 NSLog(@"Cache cleared: %d\n", error); |
83 }]; | 81 }]; |
84 } | 82 } |
85 | 83 |
86 - (void)applicationWillEnterForeground:(UIApplication*)application { | 84 - (void)applicationWillEnterForeground:(UIApplication*)application { |
87 _counter++; | 85 _counter++; |
88 [CrNet startNetLogToFile:[self currentNetLogFileName] logBytes:NO]; | 86 [CrNet startNetLogToFile:[self currentNetLogFileName] logBytes:NO]; |
89 } | 87 } |
90 | 88 |
91 @end | 89 @end |
OLD | NEW |