Chromium Code Reviews| 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."; |