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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/l10n_util.cc

Issue 641693008: Fix crash in ResolveLanguageListOnBlockingPool (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/webui/chromeos/login/l10n_util.h" 5 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 scoped_ptr<chromeos::locale_util::LanguageSwitchResult> 425 scoped_ptr<chromeos::locale_util::LanguageSwitchResult>
426 language_switch_result, 426 language_switch_result,
427 UILanguageListResolvedCallback callback) { 427 UILanguageListResolvedCallback callback) {
428 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 428 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
429 429
430 scoped_ptr<scoped_ptr<base::ListValue>> new_language_list( 430 scoped_ptr<scoped_ptr<base::ListValue>> new_language_list(
431 new scoped_ptr<base::ListValue>()); 431 new scoped_ptr<base::ListValue>());
432 scoped_ptr<std::string> new_language_list_locale(new std::string); 432 scoped_ptr<std::string> new_language_list_locale(new std::string);
433 scoped_ptr<std::string> new_selected_language(new std::string); 433 scoped_ptr<std::string> new_selected_language(new std::string);
434 434
435 content::BrowserThread::GetBlockingPool()->PostTaskAndReply( 435 base::Closure resolve_on_pool =
436 FROM_HERE,
437 base::Bind(&ResolveLanguageListOnBlockingPool, 436 base::Bind(&ResolveLanguageListOnBlockingPool,
438 base::Owned(language_switch_result.release()), 437 base::Owned(language_switch_result.release()),
439 base::Unretained(new_language_list.get()), 438 base::Unretained(new_language_list.get()),
440 base::Unretained(new_language_list_locale.get()), 439 base::Unretained(new_language_list_locale.get()),
441 base::Unretained(new_selected_language.get())), 440 base::Unretained(new_selected_language.get()));
441
442 base::Closure on_language_list_resolved =
442 base::Bind(&OnLanguageListResolved, 443 base::Bind(&OnLanguageListResolved,
443 callback, 444 callback,
444 base::Passed(new_language_list.Pass()), 445 base::Passed(new_language_list.Pass()),
445 base::Passed(new_language_list_locale.Pass()), 446 base::Passed(new_language_list_locale.Pass()),
446 base::Passed(new_selected_language.Pass()))); 447 base::Passed(new_selected_language.Pass()));
448
449 content::BrowserThread::GetBlockingPool()->PostTaskAndReply(
450 FROM_HERE, resolve_on_pool, on_language_list_resolved);
447 } 451 }
448 452
449 scoped_ptr<base::ListValue> GetMinimalUILanguageList() { 453 scoped_ptr<base::ListValue> GetMinimalUILanguageList() {
450 const std::string application_locale = 454 const std::string application_locale =
451 g_browser_process->GetApplicationLocale(); 455 g_browser_process->GetApplicationLocale();
452 base::string16 language_native_display_name = 456 base::string16 language_native_display_name =
453 l10n_util::GetDisplayNameForLocale( 457 l10n_util::GetDisplayNameForLocale(
454 application_locale, application_locale, true); 458 application_locale, application_locale, true);
455 459
456 scoped_ptr<base::ListValue> language_list(new base::ListValue()); 460 scoped_ptr<base::ListValue> language_list(new base::ListValue());
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 scoped_ptr<base::DictionaryValue> GetCurrentKeyboardLayout() { 619 scoped_ptr<base::DictionaryValue> GetCurrentKeyboardLayout() {
616 const input_method::InputMethodDescriptor current_input_method = 620 const input_method::InputMethodDescriptor current_input_method =
617 input_method::InputMethodManager::Get() 621 input_method::InputMethodManager::Get()
618 ->GetActiveIMEState() 622 ->GetActiveIMEState()
619 ->GetCurrentInputMethod(); 623 ->GetCurrentInputMethod();
620 return CreateInputMethodsEntry(current_input_method, 624 return CreateInputMethodsEntry(current_input_method,
621 current_input_method.id()); 625 current_input_method.id());
622 } 626 }
623 627
624 } // namespace chromeos 628 } // 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