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

Unified Diff: Source/core/speech/SpeechInput.cpp

Issue 255983003: Oilpan: Move all supplements of Page, Document, and WorkerClients to the managed heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: using namespace WebCore Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/speech/SpeechInput.h ('k') | Source/core/speech/SpeechInputListener.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/speech/SpeechInput.cpp
diff --git a/Source/core/speech/SpeechInput.cpp b/Source/core/speech/SpeechInput.cpp
index ea7c449b276e4fa121579b717bf5cef04f6fdf0f..8870b7c7ba39b381294b9a7fe118e3b29e88979b 100644
--- a/Source/core/speech/SpeechInput.cpp
+++ b/Source/core/speech/SpeechInput.cpp
@@ -51,16 +51,16 @@ SpeechInput::~SpeechInput()
m_client->setListener(0);
}
-PassOwnPtr<SpeechInput> SpeechInput::create(PassOwnPtr<SpeechInputClient> client)
+PassOwnPtrWillBeRawPtr<SpeechInput> SpeechInput::create(PassOwnPtr<SpeechInputClient> client)
{
- return adoptPtr(new SpeechInput(client));
+ return adoptPtrWillBeNoop(new SpeechInput(client));
}
-int SpeechInput::registerListener(InputFieldSpeechButtonElement* listener)
+int SpeechInput::registerListener(SpeechInputListener* listener)
{
#if defined(DEBUG)
// Check if already present.
- for (HashMap<int, InputFieldSpeechButtonElement*>::iterator it = m_listeners.begin(); it != m_listeners.end(); ++it)
+ for (WillBeHeapHashMap<int, RawPtrWillBeWeakMember<SpeechInputListener> >::iterator it = m_listeners.begin(); it != m_listeners.end(); ++it)
ASSERT(it->value != listener);
#endif
@@ -121,6 +121,11 @@ const char* SpeechInput::supplementName()
return "SpeechInput";
}
+void SpeechInput::trace(Visitor* visitor)
+{
+ visitor->registerWeakMembers<SpeechInput, &SpeechInput::clearWeakMembers>(this);
+}
+
void provideSpeechInputTo(Page& page, PassOwnPtr<SpeechInputClient> client)
{
SpeechInput::provideTo(page, SpeechInput::supplementName(), SpeechInput::create(client));
@@ -129,8 +134,8 @@ void provideSpeechInputTo(Page& page, PassOwnPtr<SpeechInputClient> client)
void SpeechInput::clearWeakMembers(Visitor* visitor)
{
Vector<int> deadListenerIds;
- HashMap<int, InputFieldSpeechButtonElement*>::const_iterator end = m_listeners.end();
- for (HashMap<int, InputFieldSpeechButtonElement*>::const_iterator it = m_listeners.begin(); it != end; ++it) {
+ WillBeHeapHashMap<int, RawPtrWillBeWeakMember<SpeechInputListener> >::const_iterator end = m_listeners.end();
+ for (WillBeHeapHashMap<int, RawPtrWillBeWeakMember<SpeechInputListener> >::const_iterator it = m_listeners.begin(); it != end; ++it) {
if (!visitor->isAlive(it->value)) {
deadListenerIds.append(it->key);
m_client->cancelRecognition(it->key);
« no previous file with comments | « Source/core/speech/SpeechInput.h ('k') | Source/core/speech/SpeechInputListener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698