Chromium Code Reviews| Index: chrome/browser/speech/extension_api/tts_engine_extension_api.cc |
| diff --git a/chrome/browser/speech/extension_api/tts_engine_extension_api.cc b/chrome/browser/speech/extension_api/tts_engine_extension_api.cc |
| index 5f06106a88b9557785abd887195aa221ba34b4a9..36ad5ccbb7db7c68e0073a3ddebc862b30de538d 100644 |
| --- a/chrome/browser/speech/extension_api/tts_engine_extension_api.cc |
| +++ b/chrome/browser/speech/extension_api/tts_engine_extension_api.cc |
| @@ -234,6 +234,15 @@ bool TtsExtensionEngine::LoadBuiltInTtsExtension(Profile* profile) { |
| #endif |
| } |
| +Profile* TtsExtensionEngine::GetProfile(int render_process_id) { |
| + content::RenderProcessHost* rph = |
| + content::RenderProcessHost::FromID(render_process_id); |
| + if (!rph) // Guard against race conditions on RPH lifetime. |
| + return NULL; |
| + |
| + return Profile::FromBrowserContext(rph->GetBrowserContext()); |
|
dmazzoni
2014/08/11 07:23:09
Perhaps converting from BrowserContext to Profile
mrunal
2014/08/11 23:25:07
What's wrong with keeping it here? I agree TtsExte
dmazzoni
2014/08/12 06:16:01
What's wrong is that this is an implementation of
|
| +} |
| + |
| bool ExtensionTtsEngineSendTtsEventFunction::RunSync() { |
| int utterance_id; |
| EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(0, &utterance_id)); |