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

Side by Side Diff: chrome/browser/speech/extension_api/tts_extension_api_win.cc

Issue 10413054: Make ExtensionTtsPlatformImplWin a leaky singleton to avoid a crash in the destructor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add crbug link to comment Created 8 years, 7 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
« no previous file with comments | « chrome/browser/speech/extension_api/tts_extension_api_platform.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <math.h> 5 #include <math.h>
6 #include <sapi.h> 6 #include <sapi.h>
7 7
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 SPFEI(SPEI_SENTENCE_BOUNDARY) | 200 SPFEI(SPEI_SENTENCE_BOUNDARY) |
201 SPFEI(SPEI_END_INPUT_STREAM); 201 SPFEI(SPEI_END_INPUT_STREAM);
202 speech_synthesizer_->SetInterest(event_mask, event_mask); 202 speech_synthesizer_->SetInterest(event_mask, event_mask);
203 speech_synthesizer_->SetNotifyCallbackFunction( 203 speech_synthesizer_->SetNotifyCallbackFunction(
204 ExtensionTtsPlatformImplWin::SpeechEventCallback, 0, 0); 204 ExtensionTtsPlatformImplWin::SpeechEventCallback, 0, 0);
205 } 205 }
206 } 206 }
207 207
208 // static 208 // static
209 ExtensionTtsPlatformImplWin* ExtensionTtsPlatformImplWin::GetInstance() { 209 ExtensionTtsPlatformImplWin* ExtensionTtsPlatformImplWin::GetInstance() {
210 return Singleton<ExtensionTtsPlatformImplWin>::get(); 210 return Singleton<ExtensionTtsPlatformImplWin,
211 LeakySingletonTraits<ExtensionTtsPlatformImplWin> >::get();
211 } 212 }
212 213
213 // static 214 // static
214 void ExtensionTtsPlatformImplWin::SpeechEventCallback( 215 void ExtensionTtsPlatformImplWin::SpeechEventCallback(
215 WPARAM w_param, LPARAM l_param) { 216 WPARAM w_param, LPARAM l_param) {
216 GetInstance()->OnSpeechEvent(); 217 GetInstance()->OnSpeechEvent();
217 } 218 }
OLDNEW
« no previous file with comments | « chrome/browser/speech/extension_api/tts_extension_api_platform.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698