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

Side by Side Diff: Source/core/html/track/TextTrack.cpp

Issue 24469004: Amusingly deprecate the generic version of 'ExceptionState::throwDOMException'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/forms/NumberInputType.cpp ('k') | Source/core/html/track/TextTrackCue.cpp » ('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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. 3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved.
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 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 if (!cue) 259 if (!cue)
260 return; 260 return;
261 261
262 // 4.8.10.12.5 Text track API 262 // 4.8.10.12.5 Text track API
263 263
264 // The removeCue(cue) method of TextTrack objects, when invoked, must run th e following steps: 264 // The removeCue(cue) method of TextTrack objects, when invoked, must run th e following steps:
265 265
266 // 1. If the given cue is not currently listed in the method's TextTrack 266 // 1. If the given cue is not currently listed in the method's TextTrack
267 // object's text track's text track list of cues, then throw a NotFoundError exception. 267 // object's text track's text track list of cues, then throw a NotFoundError exception.
268 if (cue->track() != this) { 268 if (cue->track() != this) {
269 es.throwDOMException(NotFoundError); 269 es.throwUninformativeAndGenericDOMException(NotFoundError);
270 return; 270 return;
271 } 271 }
272 272
273 // 2. Remove cue from the method's TextTrack object's text track's text trac k list of cues. 273 // 2. Remove cue from the method's TextTrack object's text track's text trac k list of cues.
274 if (!m_cues || !m_cues->remove(cue)) { 274 if (!m_cues || !m_cues->remove(cue)) {
275 es.throwDOMException(InvalidStateError); 275 es.throwUninformativeAndGenericDOMException(InvalidStateError);
276 return; 276 return;
277 } 277 }
278 278
279 cue->setTrack(0); 279 cue->setTrack(0);
280 if (m_client) 280 if (m_client)
281 m_client->textTrackRemoveCue(this, cue); 281 m_client->textTrackRemoveCue(this, cue);
282 } 282 }
283 283
284 #if ENABLE(WEBVTT_REGIONS) 284 #if ENABLE(WEBVTT_REGIONS)
285 TextTrackRegionList* TextTrack::regionList() 285 TextTrackRegionList* TextTrack::regionList()
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 } 340 }
341 341
342 void TextTrack::removeRegion(TextTrackRegion* region, ExceptionState &es) 342 void TextTrack::removeRegion(TextTrackRegion* region, ExceptionState &es)
343 { 343 {
344 if (!region) 344 if (!region)
345 return; 345 return;
346 346
347 // 1. If the given region is not currently listed in the method's TextTrack 347 // 1. If the given region is not currently listed in the method's TextTrack
348 // object's text track list of regions, then throw a NotFoundError exception . 348 // object's text track list of regions, then throw a NotFoundError exception .
349 if (region->track() != this) { 349 if (region->track() != this) {
350 es.throwDOMException(NotFoundError); 350 es.throwUninformativeAndGenericDOMException(NotFoundError);
351 return; 351 return;
352 } 352 }
353 353
354 if (!m_regions || !m_regions->remove(region)) { 354 if (!m_regions || !m_regions->remove(region)) {
355 es.throwDOMException(InvalidStateError); 355 es.throwUninformativeAndGenericDOMException(InvalidStateError);
356 return; 356 return;
357 } 357 }
358 358
359 region->setTrack(0); 359 region->setTrack(0);
360 } 360 }
361 #endif 361 #endif
362 362
363 void TextTrack::cueWillChange(TextTrackCue* cue) 363 void TextTrack::cueWillChange(TextTrackCue* cue)
364 { 364 {
365 if (!m_client) 365 if (!m_client)
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 { 489 {
490 // "Main program" content is intrinsic to the presentation of the media file , regardless of locale. Content such as 490 // "Main program" content is intrinsic to the presentation of the media file , regardless of locale. Content such as
491 // directors commentary is not "main program" because it is not essential fo r the presentation. HTML5 doesn't have 491 // directors commentary is not "main program" because it is not essential fo r the presentation. HTML5 doesn't have
492 // a way to express this in a machine-reable form, it is typically done with the track label, so we assume that caption 492 // a way to express this in a machine-reable form, it is typically done with the track label, so we assume that caption
493 // tracks are main content and all other track types are not. 493 // tracks are main content and all other track types are not.
494 return m_kind == captionsKeyword(); 494 return m_kind == captionsKeyword();
495 } 495 }
496 496
497 } // namespace WebCore 497 } // namespace WebCore
498 498
OLDNEW
« no previous file with comments | « Source/core/html/forms/NumberInputType.cpp ('k') | Source/core/html/track/TextTrackCue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698