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

Side by Side Diff: Source/core/html/HTMLTrackElement.cpp

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix 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
« no previous file with comments | « Source/core/html/HTMLTrackElement.h ('k') | Source/core/html/HTMLUListElement.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) 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 static String urlForLoggingTrack(const KURL& url) 44 static String urlForLoggingTrack(const KURL& url)
45 { 45 {
46 static const unsigned maximumURLLengthForLogging = 128; 46 static const unsigned maximumURLLengthForLogging = 128;
47 47
48 if (url.string().length() < maximumURLLengthForLogging) 48 if (url.string().length() < maximumURLLengthForLogging)
49 return url.string(); 49 return url.string();
50 return url.string().substring(0, maximumURLLengthForLogging) + "..."; 50 return url.string().substring(0, maximumURLLengthForLogging) + "...";
51 } 51 }
52 #endif 52 #endif
53 53
54 inline HTMLTrackElement::HTMLTrackElement(const QualifiedName& tagName, Document * document) 54 inline HTMLTrackElement::HTMLTrackElement(const QualifiedName& tagName, Document & document)
55 : HTMLElement(tagName, document) 55 : HTMLElement(tagName, document)
56 , m_loadTimer(this, &HTMLTrackElement::loadTimerFired) 56 , m_loadTimer(this, &HTMLTrackElement::loadTimerFired)
57 { 57 {
58 LOG(Media, "HTMLTrackElement::HTMLTrackElement - %p", this); 58 LOG(Media, "HTMLTrackElement::HTMLTrackElement - %p", this);
59 ASSERT(hasTagName(trackTag)); 59 ASSERT(hasTagName(trackTag));
60 ScriptWrappable::init(this); 60 ScriptWrappable::init(this);
61 } 61 }
62 62
63 HTMLTrackElement::~HTMLTrackElement() 63 HTMLTrackElement::~HTMLTrackElement()
64 { 64 {
65 if (m_track) 65 if (m_track)
66 m_track->clearClient(); 66 m_track->clearClient();
67 } 67 }
68 68
69 PassRefPtr<HTMLTrackElement> HTMLTrackElement::create(const QualifiedName& tagNa me, Document* document) 69 PassRefPtr<HTMLTrackElement> HTMLTrackElement::create(const QualifiedName& tagNa me, Document& document)
70 { 70 {
71 return adoptRef(new HTMLTrackElement(tagName, document)); 71 return adoptRef(new HTMLTrackElement(tagName, document));
72 } 72 }
73 73
74 Node::InsertionNotificationRequest HTMLTrackElement::insertedInto(ContainerNode* insertionPoint) 74 Node::InsertionNotificationRequest HTMLTrackElement::insertedInto(ContainerNode* insertionPoint)
75 { 75 {
76 LOG(Media, "HTMLTrackElement::insertedInto"); 76 LOG(Media, "HTMLTrackElement::insertedInto");
77 77
78 // Since we've moved to a new parent, we may now be able to load. 78 // Since we've moved to a new parent, we may now be able to load.
79 scheduleLoad(); 79 scheduleLoad();
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 HTMLMediaElement* HTMLTrackElement::mediaElement() const 357 HTMLMediaElement* HTMLTrackElement::mediaElement() const
358 { 358 {
359 Element* parent = parentElement(); 359 Element* parent = parentElement();
360 if (parent && parent->isMediaElement()) 360 if (parent && parent->isMediaElement())
361 return toHTMLMediaElement(parentNode()); 361 return toHTMLMediaElement(parentNode());
362 return 0; 362 return 0;
363 } 363 }
364 364
365 } 365 }
366 366
OLDNEW
« no previous file with comments | « Source/core/html/HTMLTrackElement.h ('k') | Source/core/html/HTMLUListElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698