From 0b34577625ef63d0dea9c72ac9972d111b359ff7 Mon Sep 17 00:00:00 2001 From: kthelgason Date: Fri, 24 Feb 2017 08:06:17 -0800 Subject: [PATCH] Revert of move some warning suppressions from SocketRocket. (patchset #2 id:70001 of https://codereview.webrtc.org/2718653002/ ) Reason for revert: Breaks AppRTCMobile in release configuration Original issue's description: > Reland of move some warning suppressions from SocketRocket. (patchset #1 id:1 of https://codereview.webrtc.org/2714123002/ ) > > Reason for revert: > Buildbot issues have been fixed. > > Original issue's description: > > Revert of Remove some warning suppressions from SocketRocket. (patchset #1 id:1 of https://codereview.webrtc.org/2704383004/ ) > > > > Reason for revert: > > Breaks buildbot > > > > Original issue's description: > > > Remove some warning suppressions from SocketRocket. > > > > > > These warnings started appearing on a clang update. This CL patches the > > > vendored library and removes the supression. We assert on the return as > > > we're not equipped to deal with failures there anyway. > > > > > > BUG=webrtc:6396 > > > NOTRY=true > > > > > > Review-Url: https://codereview.webrtc.org/2704383004 > > > Cr-Commit-Position: refs/heads/master@{#16820} > > > Committed: https://chromium.googlesource.com/external/webrtc/+/49990e88fb523901b28d10f2026602cb86528b0d > > > > TBR=kjellander@webrtc.org,magjed@webrtc.org > > # Skipping CQ checks because original CL landed less than 1 days ago. > > NOPRESUBMIT=true > > NOTREECHECKS=true > > NOTRY=true > > BUG=webrtc:6396 > > > > Review-Url: https://codereview.webrtc.org/2714123002 > > Cr-Commit-Position: refs/heads/master@{#16822} > > Committed: https://chromium.googlesource.com/external/webrtc/+/e47de1a69c2f574d71728b16825f8cdbf7407481 > > TBR=kjellander@webrtc.org,magjed@webrtc.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=webrtc:6396 > > Review-Url: https://codereview.webrtc.org/2718653002 > Cr-Commit-Position: refs/heads/master@{#16823} > Committed: https://chromium.googlesource.com/external/webrtc/+/00df91ce50c71b7895ec24246c71c08568236967 TBR=kjellander@webrtc.org,magjed@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=webrtc:6396 Review-Url: https://codereview.webrtc.org/2718703002 Cr-Commit-Position: refs/heads/master@{#16829} --- webrtc/examples/BUILD.gn | 4 ++++ .../AppRTCMobile/third_party/SocketRocket/SRWebSocket.m | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/webrtc/examples/BUILD.gn b/webrtc/examples/BUILD.gn index d575c65b09..0098d69781 100644 --- a/webrtc/examples/BUILD.gn +++ b/webrtc/examples/BUILD.gn @@ -399,6 +399,10 @@ if (is_ios || (is_mac && target_cpu != "x86")) { cflags_objc = [ # Enabled for cflags_objc in build/config/compiler/BUILD.gn. "-Wno-objc-missing-property-synthesis", + + # Hide the warning for SecRandomCopyBytes(), until we update to upstream. + # https://bugs.chromium.org/p/webrtc/issues/detail?id=6396 + "-Wno-unused-result", ] } diff --git a/webrtc/examples/objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m b/webrtc/examples/objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m index b9148cd384..b4868a7898 100644 --- a/webrtc/examples/objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m +++ b/webrtc/examples/objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m @@ -504,7 +504,7 @@ static __strong NSData *CRLFCRLF; CFHTTPMessageSetHeaderFieldValue(request, CFSTR("Host"), (__bridge CFStringRef)(_url.port ? [NSString stringWithFormat:@"%@:%@", _url.host, _url.port] : _url.host)); NSMutableData *keyBytes = [[NSMutableData alloc] initWithLength:16]; - assert(!SecRandomCopyBytes(kSecRandomDefault, keyBytes.length, keyBytes.mutableBytes)); + SecRandomCopyBytes(kSecRandomDefault, keyBytes.length, keyBytes.mutableBytes); if ([keyBytes respondsToSelector:@selector(base64EncodedStringWithOptions:)]) { _secKey = [keyBytes base64EncodedStringWithOptions:0]; @@ -528,7 +528,7 @@ static __strong NSData *CRLFCRLF; [_urlRequest.allHTTPHeaderFields enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { CFHTTPMessageSetHeaderFieldValue(request, (__bridge CFStringRef)key, (__bridge CFStringRef)obj); }]; - + NSData *message = CFBridgingRelease(CFHTTPMessageCopySerializedMessage(request)); CFRelease(request); @@ -1361,7 +1361,7 @@ static const size_t SRFrameHeaderOverhead = 32; } } else { uint8_t *mask_key = frame_buffer + frame_buffer_size; - assert(!SecRandomCopyBytes(kSecRandomDefault, sizeof(uint32_t), (uint8_t *)mask_key)); + SecRandomCopyBytes(kSecRandomDefault, sizeof(uint32_t), (uint8_t *)mask_key); frame_buffer_size += sizeof(uint32_t); // TODO: could probably optimize this with SIMD