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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 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 16 matching lines...) Expand all
27 27
28 #include "core/html/track/LoadableTextTrack.h" 28 #include "core/html/track/LoadableTextTrack.h"
29 29
30 #include "core/html/HTMLTrackElement.h" 30 #include "core/html/HTMLTrackElement.h"
31 #include "core/html/track/TextTrackCueList.h" 31 #include "core/html/track/TextTrackCueList.h"
32 #include "core/html/track/TextTrackRegionList.h" 32 #include "core/html/track/TextTrackRegionList.h"
33 33
34 namespace WebCore { 34 namespace WebCore {
35 35
36 LoadableTextTrack::LoadableTextTrack(HTMLTrackElement* track, const String& kind , const String& label, const String& language) 36 LoadableTextTrack::LoadableTextTrack(HTMLTrackElement* track, const String& kind , const String& label, const String& language)
37 : TextTrack(track->document(), track, kind, label, language, TrackElement) 37 : TextTrack(&track->document(), track, kind, label, language, TrackElement)
38 , m_trackElement(track) 38 , m_trackElement(track)
39 , m_loadTimer(this, &LoadableTextTrack::loadTimerFired) 39 , m_loadTimer(this, &LoadableTextTrack::loadTimerFired)
40 , m_isDefault(false) 40 , m_isDefault(false)
41 { 41 {
42 } 42 }
43 43
44 LoadableTextTrack::~LoadableTextTrack() 44 LoadableTextTrack::~LoadableTextTrack()
45 { 45 {
46 } 46 }
47 47
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 m_loader->cancelLoad(); 82 m_loader->cancelLoad();
83 83
84 if (!m_trackElement) 84 if (!m_trackElement)
85 return; 85 return;
86 86
87 // 4.8.10.12.3 Sourcing out-of-band text tracks (continued) 87 // 4.8.10.12.3 Sourcing out-of-band text tracks (continued)
88 88
89 // 4. Download: If URL is not the empty string, perform a potentially CORS-e nabled fetch of URL, with the 89 // 4. Download: If URL is not the empty string, perform a potentially CORS-e nabled fetch of URL, with the
90 // mode being the state of the media element's crossorigin content attribute , the origin being the 90 // mode being the state of the media element's crossorigin content attribute , the origin being the
91 // origin of the media element's Document, and the default origin behaviour set to fail. 91 // origin of the media element's Document, and the default origin behaviour set to fail.
92 m_loader = TextTrackLoader::create(this, static_cast<ScriptExecutionContext* >(m_trackElement->document())); 92 m_loader = TextTrackLoader::create(this, static_cast<ScriptExecutionContext* >(&m_trackElement->document()));
93 if (!m_loader->load(m_url, m_trackElement->mediaElementCrossOriginAttribute( ))) 93 if (!m_loader->load(m_url, m_trackElement->mediaElementCrossOriginAttribute( )))
94 m_trackElement->didCompleteLoad(this, HTMLTrackElement::Failure); 94 m_trackElement->didCompleteLoad(this, HTMLTrackElement::Failure);
95 } 95 }
96 96
97 void LoadableTextTrack::newCuesAvailable(TextTrackLoader* loader) 97 void LoadableTextTrack::newCuesAvailable(TextTrackLoader* loader)
98 { 98 {
99 ASSERT_UNUSED(loader, m_loader == loader); 99 ASSERT_UNUSED(loader, m_loader == loader);
100 100
101 Vector<RefPtr<TextTrackCue> > newCues; 101 Vector<RefPtr<TextTrackCue> > newCues;
102 m_loader->getNewCues(newCues); 102 m_loader->getNewCues(newCues);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 return index; 156 return index;
157 ++index; 157 ++index;
158 } 158 }
159 ASSERT_NOT_REACHED(); 159 ASSERT_NOT_REACHED();
160 160
161 return 0; 161 return 0;
162 } 162 }
163 163
164 } // namespace WebCore 164 } // namespace WebCore
165 165
OLDNEW
« no previous file with comments | « Source/core/html/shadow/TextControlInnerElements.cpp ('k') | Source/core/html/track/WebVTTElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698