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

Side by Side Diff: components/cronet/ios/Cronet.mm

Issue 2273403003: Moving gRPC support interfaces out of cronet and into a new component. (Closed)
Patch Set: Add DEPS Created 4 years, 2 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
OLDNEW
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 "components/cronet/ios/Cronet.h" 5 #import "components/cronet/ios/Cronet.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 + (NSString*)getUserAgent { 105 + (NSString*)getUserAgent {
106 if (!gChromeNet.Get().get()) { 106 if (!gChromeNet.Get().get()) {
107 return nil; 107 return nil;
108 } 108 }
109 109
110 return [NSString stringWithCString:gChromeNet.Get()->user_agent().c_str() 110 return [NSString stringWithCString:gChromeNet.Get()->user_agent().c_str()
111 encoding:[NSString defaultCStringEncoding]]; 111 encoding:[NSString defaultCStringEncoding]];
112 } 112 }
113 113
114 + (cronet_engine*)getGlobalEngine { 114 + (stream_engine*)getGlobalEngine {
115 DCHECK(gChromeNet.Get().get()); 115 DCHECK(gChromeNet.Get().get());
116 if (gChromeNet.Get().get()) { 116 if (gChromeNet.Get().get()) {
117 static cronet_engine engine; 117 static stream_engine engine;
118 engine.obj = gChromeNet.Get().get(); 118 engine.obj = gChromeNet.Get()->GetURLRequestContextGetter();
119 return &engine; 119 return &engine;
120 } 120 }
121 return nil; 121 return nil;
122 } 122 }
123 123
124 // This is a non-public dummy method that prevents the linker from stripping out 124 // This is a non-public dummy method that prevents the linker from stripping out
125 // the otherwise non-referenced methods from 'cronet_bidirectional_stream.cc'. 125 // the otherwise non-referenced methods from 'bidirectional_stream.cc'.
126 + (void)preventStrippingCronetBidirectionalStream { 126 + (void)preventStrippingCronetBidirectionalStream {
127 cronet_bidirectional_stream_create(NULL, 0, 0); 127 bidirectional_stream_create(NULL, 0, 0);
128 } 128 }
129 129
130 @end 130 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698