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); |
}; |