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

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

Issue 60423008: Simplify LoadableTextTrack construction (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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 | « Source/core/html/HTMLTrackElement.idl ('k') | Source/core/html/track/LoadableTextTrack.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) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple 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 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 23 matching lines...) Expand all
34 #include <math.h> 34 #include <math.h>
35 35
36 namespace WebCore { 36 namespace WebCore {
37 37
38 PassRefPtr<InbandTextTrack> InbandTextTrack::create(Document& document, TextTrac kClient* client, PassRefPtr<InbandTextTrackPrivate> playerPrivate) 38 PassRefPtr<InbandTextTrack> InbandTextTrack::create(Document& document, TextTrac kClient* client, PassRefPtr<InbandTextTrackPrivate> playerPrivate)
39 { 39 {
40 return adoptRef(new InbandTextTrack(document, client, playerPrivate)); 40 return adoptRef(new InbandTextTrack(document, client, playerPrivate));
41 } 41 }
42 42
43 InbandTextTrack::InbandTextTrack(Document& document, TextTrackClient* client, Pa ssRefPtr<InbandTextTrackPrivate> tracksPrivate) 43 InbandTextTrack::InbandTextTrack(Document& document, TextTrackClient* client, Pa ssRefPtr<InbandTextTrackPrivate> tracksPrivate)
44 : TextTrack(document, client, emptyString(), tracksPrivate->label(), tracksP rivate->language(), InBand) 44 : TextTrack(document, client, emptyAtom, tracksPrivate->label(), tracksPriva te->language(), InBand)
45 , m_private(tracksPrivate) 45 , m_private(tracksPrivate)
46 { 46 {
47 m_private->setClient(this); 47 m_private->setClient(this);
48 48
49 switch (m_private->kind()) { 49 switch (m_private->kind()) {
50 case InbandTextTrackPrivate::Subtitles: 50 case InbandTextTrackPrivate::Subtitles:
51 setKind(TextTrack::subtitlesKeyword()); 51 setKind(TextTrack::subtitlesKeyword());
52 break; 52 break;
53 case InbandTextTrackPrivate::Captions: 53 case InbandTextTrackPrivate::Captions:
54 setKind(TextTrack::captionsKeyword()); 54 setKind(TextTrack::captionsKeyword());
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 cue->setId(id); 114 cue->setId(id);
115 cue->setCueSettings(settings); 115 cue->setCueSettings(settings);
116 116
117 if (hasCue(cue.get())) 117 if (hasCue(cue.get()))
118 return; 118 return;
119 119
120 addCue(cue); 120 addCue(cue);
121 } 121 }
122 122
123 } // namespace WebCore 123 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTrackElement.idl ('k') | Source/core/html/track/LoadableTextTrack.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698