Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: ios/crnet/CrNet.mm

Issue 2134843002: Fixed crashes in CrNetEnvironment::ConfigureSdchOnNetworkThread() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ios/crnet/CrNet.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ios/crnet/CrNet.h" 5 #import "ios/crnet/CrNet.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #import "ios/net/crn_http_protocol_handler.h" 9 #import "ios/net/crn_http_protocol_handler.h"
10 #import "ios/crnet/crnet_environment.h" 10 #import "ios/crnet/crnet_environment.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 53
54 g_chrome_net->Install(); 54 g_chrome_net->Install();
55 g_chrome_net->SetHTTPProtocolHandlerRegistered(true); 55 g_chrome_net->SetHTTPProtocolHandlerRegistered(true);
56 g_chrome_net->SetRequestFilterBlock(g_request_filter_block); 56 g_chrome_net->SetRequestFilterBlock(g_request_filter_block);
57 } 57 }
58 58
59 + (void)install { 59 + (void)install {
60 static dispatch_once_t onceToken; 60 static dispatch_once_t onceToken;
61 dispatch_once(&onceToken, ^{ 61 dispatch_once(&onceToken, ^{
62 if (![NSThread isMainThread]) {
63 dispatch_sync(dispatch_get_main_queue(), ^(void) {
64 [self installInternal];
65 });
66 } else {
62 [self installInternal]; 67 [self installInternal];
68 }
63 }); 69 });
64 } 70 }
65 71
66 + (void)installIntoSessionConfiguration:(NSURLSessionConfiguration*)config { 72 + (void)installIntoSessionConfiguration:(NSURLSessionConfiguration*)config {
67 g_chrome_net->InstallIntoSessionConfiguration(config); 73 g_chrome_net->InstallIntoSessionConfiguration(config);
68 } 74 }
69 75
70 + (void)installWithPartialUserAgent:(NSString *)partialUserAgent { 76 + (void)installWithPartialUserAgent:(NSString *)partialUserAgent {
71 [self setPartialUserAgent:partialUserAgent]; 77 [self setPartialUserAgent:partialUserAgent];
72 [self install]; 78 [self install];
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 } 135 }
130 } 136 }
131 137
132 + (void)clearCacheWithCompletionCallback:(ClearCacheCallback)clearCacheCallback { 138 + (void)clearCacheWithCompletionCallback:(ClearCacheCallback)clearCacheCallback {
133 if (g_chrome_net) { 139 if (g_chrome_net) {
134 g_chrome_net->ClearCache(clearCacheCallback); 140 g_chrome_net->ClearCache(clearCacheCallback);
135 } 141 }
136 } 142 }
137 143
138 @end 144 @end
OLDNEW
« no previous file with comments | « ios/crnet/CrNet.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698