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

Unified Diff: ui/base/win/tsf_bridge.cc

Issue 10912171: Introduce RenderWidgetHostViewWinTest for Tsf handling (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Remove call count expectations. Created 8 years, 3 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
Index: ui/base/win/tsf_bridge.cc
diff --git a/ui/base/win/tsf_bridge.cc b/ui/base/win/tsf_bridge.cc
index 3fb857f4af1ddbd572ffa44dafda07dce09fe992..5f8649d2897322098d448d216ce296adaeb75051 100644
--- a/ui/base/win/tsf_bridge.cc
+++ b/ui/base/win/tsf_bridge.cc
@@ -327,6 +327,17 @@ bool TsfBridge::Initialize() {
}
// static
+TsfBridge* TsfBridge::ReplaceForTesting(TsfBridge* bridge) {
+ if (MessageLoop::current()->type() != MessageLoop::TYPE_UI) {
+ VLOG(1) << "Do not use TsfBridge without UI thread.";
+ return NULL;
+ }
+ TsfBridge* old_bridge = TsfBridge::GetInstance();
sky 2012/09/10 16:44:09 Who owns old_bridge?
Seigo Nonaka 2012/09/10 19:04:10 The caller should release old_bridge. Revise comme
+ tls_tsf_bridge.Set(bridge);
+ return old_bridge;
+}
+
+// static
TsfBridge* TsfBridge::GetInstance() {
if (MessageLoop::current()->type() != MessageLoop::TYPE_UI) {
VLOG(1) << "Do not use TsfBridge without UI thread.";

Powered by Google App Engine
This is Rietveld 408576698