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

Unified Diff: content/public/test/fake_speech_recognition_manager.cc

Issue 170243005: Making sure that SpeechRecognitionDispatcherHost is not used after free (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed comments Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/test/fake_speech_recognition_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/fake_speech_recognition_manager.cc
diff --git a/content/public/test/fake_speech_recognition_manager.cc b/content/public/test/fake_speech_recognition_manager.cc
index 7f8e367a4326b73ca06e86c8830cc5ba0bbbe997..91e94dd1a66c311e46fa943d0ba78d4e7f6ad0f7 100644
--- a/content/public/test/fake_speech_recognition_manager.cc
+++ b/content/public/test/fake_speech_recognition_manager.cc
@@ -50,7 +50,7 @@ int FakeSpeechRecognitionManager::CreateSession(
VLOG(1) << "FAKE CreateSession invoked.";
EXPECT_EQ(0, session_id_);
EXPECT_EQ(NULL, listener_);
- listener_ = config.event_listener;
+ listener_ = config.event_listener.get();
if (config.grammars.size() > 0)
grammar_ = config.grammars[0].url;
session_ctx_ = config.initial_context;
@@ -98,13 +98,11 @@ void FakeSpeechRecognitionManager::StopAudioCaptureForSession(int session_id) {
// Nothing to do here since we aren't really recording.
}
-void FakeSpeechRecognitionManager::AbortAllSessionsForListener(
- SpeechRecognitionEventListener* listener) {
+void FakeSpeechRecognitionManager::AbortAllSessionsForRenderProcess(
+ int render_process_id) {
VLOG(1) << "CancelAllRequestsWithDelegate invoked.";
- // listener_ is set to NULL if a fake result was received (see below), so
- // check that listener_ matches the incoming parameter only when there is
- // no fake result sent.
- EXPECT_TRUE(should_send_fake_response_ || listener_ == listener);
+ EXPECT_TRUE(should_send_fake_response_ ||
+ session_ctx_.render_process_id == render_process_id);
did_cancel_all_ = true;
}
« no previous file with comments | « content/public/test/fake_speech_recognition_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698