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

Side by Side Diff: third_party/WebKit/Source/modules/speech/DOMWindowSpeechSynthesis.cpp

Issue 1846913009: HeapSupplements are now just Supplements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 43
44 const char* DOMWindowSpeechSynthesis::supplementName() 44 const char* DOMWindowSpeechSynthesis::supplementName()
45 { 45 {
46 return "DOMWindowSpeechSynthesis"; 46 return "DOMWindowSpeechSynthesis";
47 } 47 }
48 48
49 // static 49 // static
50 DOMWindowSpeechSynthesis& DOMWindowSpeechSynthesis::from(LocalDOMWindow& window) 50 DOMWindowSpeechSynthesis& DOMWindowSpeechSynthesis::from(LocalDOMWindow& window)
51 { 51 {
52 DOMWindowSpeechSynthesis* supplement = static_cast<DOMWindowSpeechSynthesis* >(HeapSupplement<LocalDOMWindow>::from(window, supplementName())); 52 DOMWindowSpeechSynthesis* supplement = static_cast<DOMWindowSpeechSynthesis* >(Supplement<LocalDOMWindow>::from(window, supplementName()));
53 if (!supplement) { 53 if (!supplement) {
54 supplement = new DOMWindowSpeechSynthesis(window); 54 supplement = new DOMWindowSpeechSynthesis(window);
55 provideTo(window, supplementName(), supplement); 55 provideTo(window, supplementName(), supplement);
56 } 56 }
57 return *supplement; 57 return *supplement;
58 } 58 }
59 59
60 // static 60 // static
61 SpeechSynthesis* DOMWindowSpeechSynthesis::speechSynthesis(DOMWindow& window) 61 SpeechSynthesis* DOMWindowSpeechSynthesis::speechSynthesis(DOMWindow& window)
62 { 62 {
63 return DOMWindowSpeechSynthesis::from(toLocalDOMWindow(window)).speechSynthe sis(); 63 return DOMWindowSpeechSynthesis::from(toLocalDOMWindow(window)).speechSynthe sis();
64 } 64 }
65 65
66 SpeechSynthesis* DOMWindowSpeechSynthesis::speechSynthesis() 66 SpeechSynthesis* DOMWindowSpeechSynthesis::speechSynthesis()
67 { 67 {
68 if (!m_speechSynthesis && frame()) 68 if (!m_speechSynthesis && frame())
69 m_speechSynthesis = SpeechSynthesis::create(frame()->domWindow()->getExe cutionContext()); 69 m_speechSynthesis = SpeechSynthesis::create(frame()->domWindow()->getExe cutionContext());
70 return m_speechSynthesis; 70 return m_speechSynthesis;
71 } 71 }
72 72
73 DEFINE_TRACE(DOMWindowSpeechSynthesis) 73 DEFINE_TRACE(DOMWindowSpeechSynthesis)
74 { 74 {
75 visitor->trace(m_speechSynthesis); 75 visitor->trace(m_speechSynthesis);
76 HeapSupplement<LocalDOMWindow>::trace(visitor); 76 Supplement<LocalDOMWindow>::trace(visitor);
77 DOMWindowProperty::trace(visitor); 77 DOMWindowProperty::trace(visitor);
78 } 78 }
79 79
80 } // namespace blink 80 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698