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

Side by Side Diff: chrome/browser/win/settings_app_monitor.cc

Issue 2076163002: Migrate SequencedTaskRunnerHandle calls to TaskRunnerHandle calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mix_c_Ab_1_scheduler_support_parallelTRH
Patch Set: Created 4 years, 6 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/win/settings_app_monitor.h" 5 #include "chrome/browser/win/settings_app_monitor.h"
6 6
7 #include <atlbase.h> 7 #include <atlbase.h>
8 #include <atlcom.h> 8 #include <atlcom.h>
9 #include <oleauto.h> 9 #include <oleauto.h>
10 #include <stdint.h> 10 #include <stdint.h>
11 #include <uiautomation.h> 11 #include <uiautomation.h>
12 12
13 #include <algorithm> 13 #include <algorithm>
14 #include <iterator> 14 #include <iterator>
15 #include <string> 15 #include <string>
16 #include <utility> 16 #include <utility>
17 #include <vector> 17 #include <vector>
18 18
19 #include "base/bind.h" 19 #include "base/bind.h"
20 #include "base/callback.h" 20 #include "base/callback.h"
21 #include "base/location.h" 21 #include "base/location.h"
22 #include "base/memory/ref_counted.h" 22 #include "base/memory/ref_counted.h"
23 #include "base/sequenced_task_runner.h" 23 #include "base/sequenced_task_runner.h"
24 #include "base/single_thread_task_runner.h" 24 #include "base/single_thread_task_runner.h"
25 #include "base/strings/pattern.h" 25 #include "base/strings/pattern.h"
26 #include "base/strings/string16.h" 26 #include "base/strings/string16.h"
27 #include "base/strings/string_number_conversions.h" 27 #include "base/strings/string_number_conversions.h"
28 #include "base/strings/string_util.h" 28 #include "base/strings/string_util.h"
29 #include "base/threading/sequenced_task_runner_handle.h" 29 #include "base/threading/task_runner_handle.h"
30 #include "base/win/scoped_comptr.h" 30 #include "base/win/scoped_comptr.h"
31 #include "base/win/scoped_variant.h" 31 #include "base/win/scoped_variant.h"
32 #include "ui/base/win/atl_module.h" 32 #include "ui/base/win/atl_module.h"
33 33
34 namespace shell_integration { 34 namespace shell_integration {
35 namespace win { 35 namespace win {
36 36
37 // SettingsAppMonitor::Context ------------------------------------------------- 37 // SettingsAppMonitor::Context -------------------------------------------------
38 38
39 // The guts of the monitor which runs on a dedicated thread in the 39 // The guts of the monitor which runs on a dedicated thread in the
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 weak_ptr_factory_(this) { 698 weak_ptr_factory_(this) {
699 ui::win::CreateATLModuleIfNeeded(); 699 ui::win::CreateATLModuleIfNeeded();
700 // Start the automation thread and initialize the automation client on it. 700 // Start the automation thread and initialize the automation client on it.
701 context_ = Context::Create(); 701 context_ = Context::Create();
702 automation_thread_.init_com_with_mta(true); 702 automation_thread_.init_com_with_mta(true);
703 automation_thread_.Start(); 703 automation_thread_.Start();
704 automation_thread_.task_runner()->PostTask( 704 automation_thread_.task_runner()->PostTask(
705 FROM_HERE, 705 FROM_HERE,
706 base::Bind(&SettingsAppMonitor::Context::Initialize, context_, 706 base::Bind(&SettingsAppMonitor::Context::Initialize, context_,
707 base::Unretained(automation_thread_.task_runner().get()), 707 base::Unretained(automation_thread_.task_runner().get()),
708 base::SequencedTaskRunnerHandle::Get(), 708 base::TaskRunnerHandle::GetSequenced(),
709 weak_ptr_factory_.GetWeakPtr())); 709 weak_ptr_factory_.GetWeakPtr()));
710 } 710 }
711 711
712 SettingsAppMonitor::~SettingsAppMonitor() { 712 SettingsAppMonitor::~SettingsAppMonitor() {
713 DCHECK(thread_checker_.CalledOnValidThread()); 713 DCHECK(thread_checker_.CalledOnValidThread());
714 714
715 // context_ is still valid when the caller destroys the instance before the 715 // context_ is still valid when the caller destroys the instance before the
716 // callback(s) have fired. In this case, delete the context on the automation 716 // callback(s) have fired. In this case, delete the context on the automation
717 // thread before joining with it. DeleteSoon is not used because the monitor 717 // thread before joining with it. DeleteSoon is not used because the monitor
718 // has only a WeakPtr to the context that is bound to the automation thread. 718 // has only a WeakPtr to the context that is bound to the automation thread.
(...skipping 18 matching lines...) Expand all
737 delegate_->OnChooserInvoked(); 737 delegate_->OnChooserInvoked();
738 } 738 }
739 739
740 void SettingsAppMonitor::OnBrowserChosen(const base::string16& browser_name) { 740 void SettingsAppMonitor::OnBrowserChosen(const base::string16& browser_name) {
741 DCHECK(thread_checker_.CalledOnValidThread()); 741 DCHECK(thread_checker_.CalledOnValidThread());
742 delegate_->OnBrowserChosen(browser_name); 742 delegate_->OnBrowserChosen(browser_name);
743 } 743 }
744 744
745 } // namespace win 745 } // namespace win
746 } // namespace shell_integration 746 } // namespace shell_integration
OLDNEW
« no previous file with comments | « chrome/browser/chrome_browser_main_extra_parts_x11.cc ('k') | components/safe_json/json_sanitizer_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698