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

Unified Diff: chrome/browser/speech/tts_message_filter.h

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 | « chrome/browser/speech/tts_controller_impl.cc ('k') | chrome/browser/speech/tts_message_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/speech/tts_message_filter.h
diff --git a/chrome/browser/speech/tts_message_filter.h b/chrome/browser/speech/tts_message_filter.h
index 11929a91620e359a08be7bb4363b6c0810ab5061..b44fe9e98e8bc72fb7b987547f2211b3bdd2ee04 100644
--- a/chrome/browser/speech/tts_message_filter.h
+++ b/chrome/browser/speech/tts_message_filter.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_SPEECH_TTS_MESSAGE_FILTER_H_
#include "base/memory/weak_ptr.h"
+#include "base/synchronization/lock.h"
#include "chrome/browser/speech/tts_controller.h"
#include "chrome/common/tts_messages.h"
#include "content/public/browser/browser_message_filter.h"
@@ -52,10 +53,16 @@ class TtsMessageFilter
void OnChannelClosingInUIThread();
+ void Cleanup();
+
+ // Thread-safe check to make sure this class is still valid and not
+ // about to be deleted.
+ bool Valid();
+
int render_process_id_;
content::BrowserContext* browser_context_;
-
- base::WeakPtrFactory<TtsMessageFilter> weak_ptr_factory_;
+ mutable base::Lock mutex_;
+ mutable bool valid_;
DISALLOW_COPY_AND_ASSIGN(TtsMessageFilter);
};
« no previous file with comments | « chrome/browser/speech/tts_controller_impl.cc ('k') | chrome/browser/speech/tts_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698