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

Side by Side Diff: content/renderer/media/webrtc/media_stream_track_metrics.cc

Issue 791923003: replace COMPILE_ASSERT with static_assert in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixups Created 5 years, 11 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 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 #include "content/renderer/media/webrtc/media_stream_track_metrics.h" 5 #include "content/renderer/media/webrtc/media_stream_track_metrics.h"
6 6
7 #include <inttypes.h> 7 #include <inttypes.h>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 pc_id, 382 pc_id,
383 track_id.c_str(), 383 track_id.c_str(),
384 stream_type == RECEIVED_STREAM ? 1 : 0); 384 stream_type == RECEIVED_STREAM ? 1 : 0);
385 385
386 base::MD5Context ctx; 386 base::MD5Context ctx;
387 base::MD5Init(&ctx); 387 base::MD5Init(&ctx);
388 base::MD5Update(&ctx, unique_id_string); 388 base::MD5Update(&ctx, unique_id_string);
389 base::MD5Digest digest; 389 base::MD5Digest digest;
390 base::MD5Final(&digest, &ctx); 390 base::MD5Final(&digest, &ctx);
391 391
392 COMPILE_ASSERT(sizeof(digest.a) > sizeof(uint64), NeedBiggerDigest); 392 static_assert(sizeof(digest.a) > sizeof(uint64), "need a bigger digest");
393 return *reinterpret_cast<uint64*>(digest.a); 393 return *reinterpret_cast<uint64*>(digest.a);
394 } 394 }
395 395
396 uint64 MediaStreamTrackMetrics::MakeUniqueId(const std::string& track_id, 396 uint64 MediaStreamTrackMetrics::MakeUniqueId(const std::string& track_id,
397 StreamType stream_type) { 397 StreamType stream_type) {
398 return MakeUniqueIdImpl( 398 return MakeUniqueIdImpl(
399 reinterpret_cast<uint64>(reinterpret_cast<void*>(this)), 399 reinterpret_cast<uint64>(reinterpret_cast<void*>(this)),
400 track_id, 400 track_id,
401 stream_type); 401 stream_type);
402 } 402 }
403 403
404 } // namespace content 404 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/gpu/stream_texture_host_android.cc ('k') | content/renderer/p2p/ipc_socket_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698