OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/net/crn_http_protocol_handler.h" | 5 #import "ios/net/crn_http_protocol_handler.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/mac/bind_objc_block.h" | 9 #include "base/mac/bind_objc_block.h" |
10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 // Empty callback. | 48 // Empty callback. |
49 void DoNothing(bool flag) {} | 49 void DoNothing(bool flag) {} |
50 | 50 |
51 } // namespace | 51 } // namespace |
52 | 52 |
53 // Bridge class to forward NSStream events to the HttpProtocolHandlerCore. | 53 // Bridge class to forward NSStream events to the HttpProtocolHandlerCore. |
54 // Lives on the IO thread. | 54 // Lives on the IO thread. |
55 @interface CRWHTTPStreamDelegate : NSObject<NSStreamDelegate> { | 55 @interface CRWHTTPStreamDelegate : NSObject<NSStreamDelegate> { |
56 @private | 56 @private |
57 // The object is owned by |_core| and has a weak reference to it. | 57 // The object is owned by |_core| and has a weak reference to it. |
58 __weak net::HttpProtocolHandlerCore* _core; | 58 net::HttpProtocolHandlerCore* _core; // weak |
59 } | 59 } |
60 - (instancetype)initWithHttpProtocolHandlerCore: | 60 - (instancetype)initWithHttpProtocolHandlerCore: |
61 (net::HttpProtocolHandlerCore*)core; | 61 (net::HttpProtocolHandlerCore*)core; |
62 // NSStreamDelegate method. | 62 // NSStreamDelegate method. |
63 - (void)stream:(NSStream*)theStream handleEvent:(NSStreamEvent)streamEvent; | 63 - (void)stream:(NSStream*)theStream handleEvent:(NSStreamEvent)streamEvent; |
64 @end | 64 @end |
65 | 65 |
66 #pragma mark - | 66 #pragma mark - |
67 #pragma mark HttpProtocolHandlerCore | 67 #pragma mark HttpProtocolHandlerCore |
68 | 68 |
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 [[DeferredCancellation alloc] initWithCore:[self getCore]]; | 1089 [[DeferredCancellation alloc] initWithCore:[self getCore]]; |
1090 NSArray* modes = @[ [[NSRunLoop currentRunLoop] currentMode] ]; | 1090 NSArray* modes = @[ [[NSRunLoop currentRunLoop] currentMode] ]; |
1091 [cancellation performSelector:@selector(cancel) | 1091 [cancellation performSelector:@selector(cancel) |
1092 onThread:[self getClientThread] | 1092 onThread:[self getClientThread] |
1093 withObject:nil | 1093 withObject:nil |
1094 waitUntilDone:NO | 1094 waitUntilDone:NO |
1095 modes:modes]; | 1095 modes:modes]; |
1096 } | 1096 } |
1097 | 1097 |
1098 @end | 1098 @end |
OLD | NEW |