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

Unified Diff: chrome/browser/speech/extension_api/tts_extension_api.cc

Issue 692203002: Stop utterances from a tab when that tab is closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't hold lock during destruction Created 6 years, 1 month 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 | « no previous file | chrome/browser/speech/tts_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/speech/extension_api/tts_extension_api.cc
diff --git a/chrome/browser/speech/extension_api/tts_extension_api.cc b/chrome/browser/speech/extension_api/tts_extension_api.cc
index 8633523fa6ffae976cbafb7cfdc39201ce8c6832..e7b65e175c62026c0ab86247117388c380fb16f0 100644
--- a/chrome/browser/speech/extension_api/tts_extension_api.cc
+++ b/chrome/browser/speech/extension_api/tts_extension_api.cc
@@ -7,7 +7,6 @@
#include <string>
#include "base/lazy_instance.h"
-#include "base/memory/weak_ptr.h"
#include "base/values.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/speech/extension_api/tts_engine_extension_api.h"
@@ -83,8 +82,7 @@ namespace extensions {
// One of these is constructed for each utterance, and deleted
// when the utterance gets any final event.
class TtsExtensionEventHandler
- : public UtteranceEventDelegate,
- public base::SupportsWeakPtr<TtsExtensionEventHandler> {
+ : public UtteranceEventDelegate {
public:
explicit TtsExtensionEventHandler(const std::string& src_extension_id);
@@ -289,8 +287,7 @@ bool TtsSpeakFunction::RunAsync() {
utterance->set_desired_event_types(desired_event_types);
utterance->set_extension_id(voice_extension_id);
utterance->set_options(options.get());
- utterance->set_event_delegate(
- (new TtsExtensionEventHandler(extension_id()))->AsWeakPtr());
+ utterance->set_event_delegate(new TtsExtensionEventHandler(extension_id()));
TtsController* controller = TtsController::GetInstance();
controller->SpeakOrEnqueue(utterance);
« no previous file with comments | « no previous file | chrome/browser/speech/tts_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698