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

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

Issue 636863003: Make SpeechRecognition per RenderFrame instead of per RenderView. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes threading issues 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
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 91e94dd1a66c311e46fa943d0ba78d4e7f6ad0f7..2a79de0f7754e9c64501ca9711f0a55355c31f84 100644
--- a/content/public/test/fake_speech_recognition_manager.cc
+++ b/content/public/test/fake_speech_recognition_manager.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/utf_string_conversions.h"
+#include "content/public/browser/render_process_host.h"
#include "content/public/browser/speech_recognition_event_listener.h"
#include "content/public/common/speech_recognition_result.h"
#include "content/public/test/test_utils.h"
@@ -98,19 +99,15 @@ void FakeSpeechRecognitionManager::StopAudioCaptureForSession(int session_id) {
// Nothing to do here since we aren't really recording.
}
-void FakeSpeechRecognitionManager::AbortAllSessionsForRenderProcess(
- int render_process_id) {
+void FakeSpeechRecognitionManager::AbortAllSessionsForRenderFrame(
+ int render_process_id, int render_frame_id) {
VLOG(1) << "CancelAllRequestsWithDelegate invoked.";
EXPECT_TRUE(should_send_fake_response_ ||
- session_ctx_.render_process_id == render_process_id);
+ (session_ctx_.render_process_id == render_process_id &&
+ session_ctx_.render_frame_id == render_frame_id));
did_cancel_all_ = true;
}
-void FakeSpeechRecognitionManager::AbortAllSessionsForRenderView(
- int render_process_id, int render_view_id) {
- NOTREACHED();
-}
-
bool FakeSpeechRecognitionManager::HasAudioInputDevices() { return true; }
base::string16 FakeSpeechRecognitionManager::GetAudioInputDeviceModel() {
@@ -118,10 +115,10 @@ base::string16 FakeSpeechRecognitionManager::GetAudioInputDeviceModel() {
}
int FakeSpeechRecognitionManager::GetSession(int render_process_id,
- int render_view_id,
+ int render_frame_id,
int request_id) const {
return session_ctx_.render_process_id == render_process_id &&
- session_ctx_.render_view_id == render_view_id &&
+ session_ctx_.render_frame_id == render_frame_id &&
session_ctx_.request_id == request_id;
}

Powered by Google App Engine
This is Rietveld 408576698