| OLD | NEW |
| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 static String urlForLoggingTrack(const KURL& url) | 43 static String urlForLoggingTrack(const KURL& url) |
| 44 { | 44 { |
| 45 static const unsigned maximumURLLengthForLogging = 128; | 45 static const unsigned maximumURLLengthForLogging = 128; |
| 46 | 46 |
| 47 if (url.string().length() < maximumURLLengthForLogging) | 47 if (url.string().length() < maximumURLLengthForLogging) |
| 48 return url.string(); | 48 return url.string(); |
| 49 return url.string().substring(0, maximumURLLengthForLogging) + "..."; | 49 return url.string().substring(0, maximumURLLengthForLogging) + "..."; |
| 50 } | 50 } |
| 51 #endif | 51 #endif |
| 52 | 52 |
| 53 inline HTMLTrackElement::HTMLTrackElement(const QualifiedName& tagName, Document
& document) | 53 inline HTMLTrackElement::HTMLTrackElement(Document& document) |
| 54 : HTMLElement(tagName, document) | 54 : HTMLElement(trackTag, document) |
| 55 , m_loadTimer(this, &HTMLTrackElement::loadTimerFired) | 55 , m_loadTimer(this, &HTMLTrackElement::loadTimerFired) |
| 56 { | 56 { |
| 57 LOG(Media, "HTMLTrackElement::HTMLTrackElement - %p", this); | 57 LOG(Media, "HTMLTrackElement::HTMLTrackElement - %p", this); |
| 58 ASSERT(hasTagName(trackTag)); | |
| 59 ScriptWrappable::init(this); | 58 ScriptWrappable::init(this); |
| 60 } | 59 } |
| 61 | 60 |
| 62 HTMLTrackElement::~HTMLTrackElement() | 61 HTMLTrackElement::~HTMLTrackElement() |
| 63 { | 62 { |
| 64 if (m_track) | 63 if (m_track) |
| 65 m_track->clearClient(); | 64 m_track->clearClient(); |
| 66 } | 65 } |
| 67 | 66 |
| 68 PassRefPtr<HTMLTrackElement> HTMLTrackElement::create(const QualifiedName& tagNa
me, Document& document) | 67 PassRefPtr<HTMLTrackElement> HTMLTrackElement::create(Document& document) |
| 69 { | 68 { |
| 70 return adoptRef(new HTMLTrackElement(tagName, document)); | 69 return adoptRef(new HTMLTrackElement(document)); |
| 71 } | 70 } |
| 72 | 71 |
| 73 Node::InsertionNotificationRequest HTMLTrackElement::insertedInto(ContainerNode*
insertionPoint) | 72 Node::InsertionNotificationRequest HTMLTrackElement::insertedInto(ContainerNode*
insertionPoint) |
| 74 { | 73 { |
| 75 LOG(Media, "HTMLTrackElement::insertedInto"); | 74 LOG(Media, "HTMLTrackElement::insertedInto"); |
| 76 | 75 |
| 77 // Since we've moved to a new parent, we may now be able to load. | 76 // Since we've moved to a new parent, we may now be able to load. |
| 78 scheduleLoad(); | 77 scheduleLoad(); |
| 79 | 78 |
| 80 HTMLElement::insertedInto(insertionPoint); | 79 HTMLElement::insertedInto(insertionPoint); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 HTMLMediaElement* HTMLTrackElement::mediaElement() const | 305 HTMLMediaElement* HTMLTrackElement::mediaElement() const |
| 307 { | 306 { |
| 308 Element* parent = parentElement(); | 307 Element* parent = parentElement(); |
| 309 if (parent && parent->isMediaElement()) | 308 if (parent && parent->isMediaElement()) |
| 310 return toHTMLMediaElement(parentNode()); | 309 return toHTMLMediaElement(parentNode()); |
| 311 return 0; | 310 return 0; |
| 312 } | 311 } |
| 313 | 312 |
| 314 } | 313 } |
| 315 | 314 |
| OLD | NEW |