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

Side by Side Diff: chrome/browser/chromeos/input_method/ibus_controller_impl.cc

Issue 12223084: Fix crash around Reset function call. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressing comment Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/input_method/ibus_controller_impl.h" 5 #include "chrome/browser/chromeos/input_method/ibus_controller_impl.h"
6 6
7 #include <algorithm> // for std::reverse. 7 #include <algorithm> // for std::reverse.
8 #include <cstdio> 8 #include <cstdio>
9 #include <cstring> // for std::strcmp. 9 #include <cstring> // for std::strcmp.
10 #include <set> 10 #include <set>
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 return StartIBusDaemon(); 239 return StartIBusDaemon();
240 } 240 }
241 return true; 241 return true;
242 } 242 }
243 243
244 void IBusControllerImpl::Reset() { 244 void IBusControllerImpl::Reset() {
245 if (!IBusConnectionsAreAlive()) 245 if (!IBusConnectionsAreAlive())
246 return; 246 return;
247 IBusInputContextClient* client 247 IBusInputContextClient* client
248 = DBusThreadManager::Get()->GetIBusInputContextClient(); 248 = DBusThreadManager::Get()->GetIBusInputContextClient();
249 if (client) 249 // We don't need to call Reset if there is no on-going input context, because
250 // the input context will be reset at initialization.
251 if (client && client->IsObjectProxyReady())
250 client->Reset(); 252 client->Reset();
251 } 253 }
252 254
253 bool IBusControllerImpl::Stop() { 255 bool IBusControllerImpl::Stop() {
254 if (ibus_daemon_status_ == IBUS_DAEMON_SHUTTING_DOWN || 256 if (ibus_daemon_status_ == IBUS_DAEMON_SHUTTING_DOWN ||
255 ibus_daemon_status_ == IBUS_DAEMON_STOP) { 257 ibus_daemon_status_ == IBUS_DAEMON_STOP) {
256 return true; 258 return true;
257 } 259 }
258 260
259 ibus_daemon_status_ = IBUS_DAEMON_SHUTTING_DOWN; 261 ibus_daemon_status_ = IBUS_DAEMON_SHUTTING_DOWN;
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 606
605 // static 607 // static
606 bool IBusControllerImpl::FindAndUpdatePropertyForTesting( 608 bool IBusControllerImpl::FindAndUpdatePropertyForTesting(
607 const chromeos::input_method::InputMethodProperty& new_prop, 609 const chromeos::input_method::InputMethodProperty& new_prop,
608 chromeos::input_method::InputMethodPropertyList* prop_list) { 610 chromeos::input_method::InputMethodPropertyList* prop_list) {
609 return FindAndUpdateProperty(new_prop, prop_list); 611 return FindAndUpdateProperty(new_prop, prop_list);
610 } 612 }
611 613
612 } // namespace input_method 614 } // namespace input_method
613 } // namespace chromeos 615 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698