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

Side by Side Diff: Source/core/html/track/vtt/VTTCue.cpp

Issue 104713002: Use the return value to signal success for VTTParser helpers (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Re-add ASSERT in markFutureAndPastNodes. Created 7 years 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 | Source/core/html/track/vtt/VTTParser.h » ('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 * Copyright (c) 2013, Opera Software ASA. All rights reserved. 2 * Copyright (c) 2013, Opera Software ASA. 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 668
669 bool isPastNode = true; 669 bool isPastNode = true;
670 double currentTimestamp = previousTimestamp; 670 double currentTimestamp = previousTimestamp;
671 if (currentTimestamp > movieTime) 671 if (currentTimestamp > movieTime)
672 isPastNode = false; 672 isPastNode = false;
673 673
674 for (Node* child = root->firstChild(); child; child = NodeTraversal::next(*c hild, root)) { 674 for (Node* child = root->firstChild(); child; child = NodeTraversal::next(*c hild, root)) {
675 if (child->nodeName() == timestampTag) { 675 if (child->nodeName() == timestampTag) {
676 unsigned position = 0; 676 unsigned position = 0;
677 String timestamp = child->nodeValue(); 677 String timestamp = child->nodeValue();
678 double currentTimestamp = VTTParser::collectTimeStamp(timestamp, &po sition); 678 double currentTimestamp;
679 ASSERT(currentTimestamp != -1); 679 bool check = VTTParser::collectTimeStamp(timestamp, &position, curre ntTimestamp);
680 ASSERT_UNUSED(check, check);
680 681
681 if (currentTimestamp > movieTime) 682 if (currentTimestamp > movieTime)
682 isPastNode = false; 683 isPastNode = false;
683 } 684 }
684 685
685 if (child->isVTTElement()) { 686 if (child->isVTTElement()) {
686 toVTTElement(child)->setIsPastNode(isPastNode); 687 toVTTElement(child)->setIsPastNode(isPastNode);
687 // Make an elemenet id match a cue id for style matching purposes. 688 // Make an elemenet id match a cue id for style matching purposes.
688 if (!id().isEmpty()) 689 if (!id().isEmpty())
689 toElement(child)->setIdAttribute(id()); 690 toElement(child)->setIdAttribute(id());
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 return m_cueBackgroundBox->executionContext(); 1099 return m_cueBackgroundBox->executionContext();
1099 } 1100 }
1100 1101
1101 Document& VTTCue::document() const 1102 Document& VTTCue::document() const
1102 { 1103 {
1103 ASSERT(m_cueBackgroundBox); 1104 ASSERT(m_cueBackgroundBox);
1104 return m_cueBackgroundBox->document(); 1105 return m_cueBackgroundBox->document();
1105 } 1106 }
1106 1107
1107 } // namespace WebCore 1108 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/html/track/vtt/VTTParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698