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

Side by Side Diff: Source/modules/speech/SpeechRecognitionResult.cpp

Issue 169343002: [WIP]Add WebPrivateHeapPtr and use it for speech platform layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * * Redistributions of source code must retain the above copyright 7 * * 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 * * Redistributions in binary form must reproduce the above copyright 9 * * 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 17 matching lines...) Expand all
28 #include "modules/speech/SpeechRecognitionResult.h" 28 #include "modules/speech/SpeechRecognitionResult.h"
29 29
30 namespace WebCore { 30 namespace WebCore {
31 31
32 DEFINE_GC_INFO(SpeechRecognitionResult); 32 DEFINE_GC_INFO(SpeechRecognitionResult);
33 33
34 SpeechRecognitionResult::~SpeechRecognitionResult() 34 SpeechRecognitionResult::~SpeechRecognitionResult()
35 { 35 {
36 } 36 }
37 37
38 PassRefPtr<SpeechRecognitionResult> SpeechRecognitionResult::create(const WillBe HeapVector<RefPtrWillBeMember<SpeechRecognitionAlternative> >& alternatives, boo l final) 38 PassRefPtrWillBeRawPtr<SpeechRecognitionResult> SpeechRecognitionResult::create( const WillBeHeapVector<RefPtrWillBeMember<SpeechRecognitionAlternative> >& alter natives, bool final)
39 { 39 {
40 return adoptRef(new SpeechRecognitionResult(alternatives, final)); 40 return adoptRefWillBeNoop(new SpeechRecognitionResult(alternatives, final));
41 } 41 }
42 42
43 SpeechRecognitionAlternative* SpeechRecognitionResult::item(unsigned long index) 43 SpeechRecognitionAlternative* SpeechRecognitionResult::item(unsigned long index)
44 { 44 {
45 if (index >= m_alternatives.size()) 45 if (index >= m_alternatives.size())
46 return 0; 46 return 0;
47 47
48 return m_alternatives[index].get(); 48 return m_alternatives[index].get();
49 } 49 }
50 50
51 SpeechRecognitionResult::SpeechRecognitionResult(const WillBeHeapVector<RefPtrWi llBeMember<SpeechRecognitionAlternative> >& alternatives, bool final) 51 SpeechRecognitionResult::SpeechRecognitionResult(const WillBeHeapVector<RefPtrWi llBeMember<SpeechRecognitionAlternative> >& alternatives, bool final)
52 : m_final(final) 52 : m_final(final)
53 , m_alternatives(alternatives) 53 , m_alternatives(alternatives)
54 { 54 {
55 ScriptWrappable::init(this); 55 ScriptWrappable::init(this);
56 } 56 }
57 57
58 void SpeechRecognitionResult::trace(Visitor* visitor) 58 void SpeechRecognitionResult::trace(Visitor* visitor)
59 { 59 {
60 visitor->trace(m_alternatives); 60 visitor->trace(m_alternatives);
61 } 61 }
62 62
63 } // namespace WebCore 63 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698