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

Side by Side Diff: third_party/WebKit/Source/modules/mediasource/SourceBuffer.cpp

Issue 2394883002: Enforce comment formatting in modules/ (Closed)
Patch Set: 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 const AtomicString& trackType, 732 const AtomicString& trackType,
733 const AtomicString& byteStreamTrackID) const { 733 const AtomicString& byteStreamTrackID) const {
734 // This is a helper for implementation of default track label and default 734 // This is a helper for implementation of default track label and default
735 // track language algorithms. 735 // track language algorithms.
736 // defaultTrackLabel spec: 736 // defaultTrackLabel spec:
737 // https://w3c.github.io/media-source/#sourcebuffer-default-track-label 737 // https://w3c.github.io/media-source/#sourcebuffer-default-track-label
738 // defaultTrackLanguage spec: 738 // defaultTrackLanguage spec:
739 // https://w3c.github.io/media-source/#sourcebuffer-default-track-language 739 // https://w3c.github.io/media-source/#sourcebuffer-default-track-language
740 740
741 // 1. If trackDefaults contains a TrackDefault object with a type attribute 741 // 1. If trackDefaults contains a TrackDefault object with a type attribute
742 // equal to type and a byteStreamTrackID attribute equal to byteStreamTrack ID, 742 // equal to type and a byteStreamTrackID attribute equal to
743 // then return the value of the label/language attribute on this matching 743 // byteStreamTrackID, then return the value of the label/language attribute
744 // object and abort these steps. 744 // on this matching object and abort these steps.
745 // 2. If trackDefaults contains a TrackDefault object with a type attribute 745 // 2. If trackDefaults contains a TrackDefault object with a type attribute
746 // equal to type and a byteStreamTrackID attribute equal to an empty 746 // equal to type and a byteStreamTrackID attribute equal to an empty
747 // string, then return the value of the label/language attribute on this 747 // string, then return the value of the label/language attribute on this
748 // matching object and abort these steps. 748 // matching object and abort these steps.
749 // 3. Return an empty string to the caller 749 // 3. Return an empty string to the caller
750 const TrackDefault* trackDefaultWithEmptyBytestreamId = nullptr; 750 const TrackDefault* trackDefaultWithEmptyBytestreamId = nullptr;
751 for (unsigned i = 0; i < m_trackDefaults->length(); ++i) { 751 for (unsigned i = 0; i < m_trackDefaults->length(); ++i) {
752 const TrackDefault* trackDefault = m_trackDefaults->item(i); 752 const TrackDefault* trackDefault = m_trackDefaults->item(i);
753 if (trackDefault->type() != trackType) 753 if (trackDefault->type() != trackType)
754 continue; 754 continue;
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 WebString language = trackInfo.language; 930 WebString language = trackInfo.language;
931 // 5.2.3 If audio language equals an empty string or the 'und' BCP 47 931 // 5.2.3 If audio language equals an empty string or the 'und' BCP 47
932 // value, then run the default track language algorithm with 932 // value, then run the default track language algorithm with
933 // byteStreamTrackID set to audio byte stream track ID and type set 933 // byteStreamTrackID set to audio byte stream track ID and type set
934 // to "audio" and assign the value returned by the algorithm to 934 // to "audio" and assign the value returned by the algorithm to
935 // audio language. 935 // audio language.
936 if (language.isEmpty() || language == "und") 936 if (language.isEmpty() || language == "und")
937 language = defaultTrackLanguage(TrackDefault::audioKeyword(), 937 language = defaultTrackLanguage(TrackDefault::audioKeyword(),
938 byteStreamTrackID); 938 byteStreamTrackID);
939 // 5.2.4 Let audio label be a label specified in the initialization 939 // 5.2.4 Let audio label be a label specified in the initialization
940 // segment for this track or an empty string if no label info is pre sent. 940 // segment for this track or an empty string if no label info is
941 // present.
941 WebString label = trackInfo.label; 942 WebString label = trackInfo.label;
942 // 5.3.5 If audio label equals an empty string, then run the default track 943 // 5.3.5 If audio label equals an empty string, then run the default track
943 // label algorithm with byteStreamTrackID set to audio byte stream 944 // label algorithm with byteStreamTrackID set to audio byte stream
944 // track ID and type set to "audio" and assign the value returned by 945 // track ID and type set to "audio" and assign the value returned by
945 // the algorithm to audio label. 946 // the algorithm to audio label.
946 if (label.isEmpty()) 947 if (label.isEmpty())
947 label = 948 label =
948 defaultTrackLabel(TrackDefault::audioKeyword(), byteStreamTrackID); 949 defaultTrackLabel(TrackDefault::audioKeyword(), byteStreamTrackID);
949 // 5.2.6 Let audio kinds be an array of kind strings specified in the 950 // 5.2.6 Let audio kinds be an array of kind strings specified in the
950 // initialization segment for this track or an empty array if no 951 // initialization segment for this track or an empty array if no
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
990 WebString language = trackInfo.language; 991 WebString language = trackInfo.language;
991 // 5.3.3 If video language equals an empty string or the 'und' BCP 47 992 // 5.3.3 If video language equals an empty string or the 'und' BCP 47
992 // value, then run the default track language algorithm with 993 // value, then run the default track language algorithm with
993 // byteStreamTrackID set to video byte stream track ID and type set 994 // byteStreamTrackID set to video byte stream track ID and type set
994 // to "video" and assign the value returned by the algorithm to 995 // to "video" and assign the value returned by the algorithm to
995 // video language. 996 // video language.
996 if (language.isEmpty() || language == "und") 997 if (language.isEmpty() || language == "und")
997 language = defaultTrackLanguage(TrackDefault::videoKeyword(), 998 language = defaultTrackLanguage(TrackDefault::videoKeyword(),
998 byteStreamTrackID); 999 byteStreamTrackID);
999 // 5.3.4 Let video label be a label specified in the initialization 1000 // 5.3.4 Let video label be a label specified in the initialization
1000 // segment for this track or an empty string if no label info is pre sent. 1001 // segment for this track or an empty string if no label info is
1002 // present.
1001 WebString label = trackInfo.label; 1003 WebString label = trackInfo.label;
1002 // 5.3.5 If video label equals an empty string, then run the default track 1004 // 5.3.5 If video label equals an empty string, then run the default track
1003 // label algorithm with byteStreamTrackID set to video byte stream 1005 // label algorithm with byteStreamTrackID set to video byte stream
1004 // track ID and type set to "video" and assign the value returned by 1006 // track ID and type set to "video" and assign the value returned by
1005 // the algorithm to video label. 1007 // the algorithm to video label.
1006 if (label.isEmpty()) 1008 if (label.isEmpty())
1007 label = 1009 label =
1008 defaultTrackLabel(TrackDefault::videoKeyword(), byteStreamTrackID); 1010 defaultTrackLabel(TrackDefault::videoKeyword(), byteStreamTrackID);
1009 // 5.3.6 Let video kinds be an array of kind strings specified in the 1011 // 5.3.6 Let video kinds be an array of kind strings specified in the
1010 // initialization segment for this track or an empty array if no 1012 // initialization segment for this track or an empty array if no
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
1484 visitor->trace(m_removeAsyncPartRunner); 1486 visitor->trace(m_removeAsyncPartRunner);
1485 visitor->trace(m_appendStreamAsyncPartRunner); 1487 visitor->trace(m_appendStreamAsyncPartRunner);
1486 visitor->trace(m_stream); 1488 visitor->trace(m_stream);
1487 visitor->trace(m_audioTracks); 1489 visitor->trace(m_audioTracks);
1488 visitor->trace(m_videoTracks); 1490 visitor->trace(m_videoTracks);
1489 EventTargetWithInlineData::trace(visitor); 1491 EventTargetWithInlineData::trace(visitor);
1490 ActiveDOMObject::trace(visitor); 1492 ActiveDOMObject::trace(visitor);
1491 } 1493 }
1492 1494
1493 } // namespace blink 1495 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698