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

Side by Side Diff: talk/app/webrtc/objc/RTCDataChannel.mm

Issue 1178843002: Adds support for webrtc::test::ResourcePath on iOS (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: nits Created 5 years, 6 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 | « no previous file | webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 RTCDataBuffer* dataBuffer = 50 RTCDataBuffer* dataBuffer =
51 [[RTCDataBuffer alloc] initWithDataBuffer:buffer]; 51 [[RTCDataBuffer alloc] initWithDataBuffer:buffer];
52 [_channel.delegate channel:_channel didReceiveMessageWithBuffer:dataBuffer]; 52 [_channel.delegate channel:_channel didReceiveMessageWithBuffer:dataBuffer];
53 } 53 }
54 54
55 private: 55 private:
56 __weak RTCDataChannel* _channel; 56 __weak RTCDataChannel* _channel;
57 }; 57 };
58 } 58 }
59 59
60 // TODO(tkchin): move to shared location 60 // TODO(henrika): move to shared location.
61 // See https://code.google.com/p/webrtc/issues/detail?id=4773 for details.
61 NSString* NSStringFromStdString(const std::string& stdString) { 62 NSString* NSStringFromStdString(const std::string& stdString) {
62 // std::string may contain null termination character so we construct 63 // std::string may contain null termination character so we construct
63 // using length. 64 // using length.
64 return [[NSString alloc] initWithBytes:stdString.data() 65 return [[NSString alloc] initWithBytes:stdString.data()
65 length:stdString.length() 66 length:stdString.length()
66 encoding:NSUTF8StringEncoding]; 67 encoding:NSUTF8StringEncoding];
67 } 68 }
68 69
69 std::string StdStringFromNSString(NSString* nsString) { 70 std::string StdStringFromNSString(NSString* nsString) {
70 NSData* charData = [nsString dataUsingEncoding:NSUTF8StringEncoding]; 71 NSData* charData = [nsString dataUsingEncoding:NSUTF8StringEncoding];
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 _observer.reset(new webrtc::RTCDataChannelObserver(self)); 272 _observer.reset(new webrtc::RTCDataChannelObserver(self));
272 } 273 }
273 return self; 274 return self;
274 } 275 }
275 276
276 - (rtc::scoped_refptr<webrtc::DataChannelInterface>)dataChannel { 277 - (rtc::scoped_refptr<webrtc::DataChannelInterface>)dataChannel {
277 return _dataChannel; 278 return _dataChannel;
278 } 279 }
279 280
280 @end 281 @end
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/audio_coding/codecs/cng/cng_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698