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

Side by Side Diff: content/browser/browser_main_loop.cc

Issue 2410123002: Remove content::BrowserThread knowledge from Device Sensors (Closed)
Patch Set: Handle DeviceSensorService's ThreadChecker Created 4 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
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 "content/browser/browser_main_loop.h" 5 #include "content/browser/browser_main_loop.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 } 1162 }
1163 1163
1164 // Must happen after the I/O thread is shutdown since this class lives on the 1164 // Must happen after the I/O thread is shutdown since this class lives on the
1165 // I/O thread and isn't threadsafe. 1165 // I/O thread and isn't threadsafe.
1166 { 1166 {
1167 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GamepadService"); 1167 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GamepadService");
1168 GamepadService::GetInstance()->Terminate(); 1168 GamepadService::GetInstance()->Terminate();
1169 } 1169 }
1170 { 1170 {
1171 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:SensorService"); 1171 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:SensorService");
1172 DeviceSensorService::GetInstance()->Shutdown(); 1172 DeviceSensorService::GetInstance()->ShutDownOnUIThread();
1173 } 1173 }
1174 #if !defined(OS_ANDROID) 1174 #if !defined(OS_ANDROID)
1175 { 1175 {
1176 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:BatteryStatusService"); 1176 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:BatteryStatusService");
1177 device::BatteryStatusService::GetInstance()->Shutdown(); 1177 device::BatteryStatusService::GetInstance()->Shutdown();
1178 } 1178 }
1179 #endif 1179 #endif
1180 { 1180 {
1181 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:DeleteDataSources"); 1181 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:DeleteDataSources");
1182 URLDataManager::DeleteDataSources(); 1182 URLDataManager::DeleteDataSources();
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1345 1345
1346 { 1346 {
1347 TRACE_EVENT0("startup", 1347 TRACE_EVENT0("startup",
1348 "BrowserMainLoop::BrowserThreadsStarted::TimeZoneMonitor"); 1348 "BrowserMainLoop::BrowserThreadsStarted::TimeZoneMonitor");
1349 time_zone_monitor_ = 1349 time_zone_monitor_ =
1350 device::TimeZoneMonitor::Create(file_thread_->task_runner()); 1350 device::TimeZoneMonitor::Create(file_thread_->task_runner());
1351 } 1351 }
1352 1352
1353 { 1353 {
1354 TRACE_EVENT0("startup", 1354 TRACE_EVENT0("startup",
1355 "BrowserMainLoop::BrowserThreadsStarted::SaveFileManager"); 1355 "BrowserMainLoop::BrowserThreadsStarted::DeviceSensorService");
1356 DeviceSensorService::GetInstance()->InitOnUIThread();
1357 }
1358
1359 {
1360 TRACE_EVENT0("startup",
1361 "BrowserMainLoop::BrowserThreadsStarted::SaveFileManager");
1356 save_file_manager_ = new SaveFileManager(); 1362 save_file_manager_ = new SaveFileManager();
1357 } 1363 }
1358 1364
1359 // Alert the clipboard class to which threads are allowed to access the 1365 // Alert the clipboard class to which threads are allowed to access the
1360 // clipboard: 1366 // clipboard:
1361 std::vector<base::PlatformThreadId> allowed_clipboard_threads; 1367 std::vector<base::PlatformThreadId> allowed_clipboard_threads;
1362 // The current thread is the UI thread. 1368 // The current thread is the UI thread.
1363 allowed_clipboard_threads.push_back(base::PlatformThread::CurrentId()); 1369 allowed_clipboard_threads.push_back(base::PlatformThread::CurrentId());
1364 #if defined(OS_WIN) 1370 #if defined(OS_WIN)
1365 // On Windows, clipboards are also used on the FILE or IO threads. 1371 // On Windows, clipboards are also used on the FILE or IO threads.
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner = 1576 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner =
1571 audio_thread_->task_runner(); 1577 audio_thread_->task_runner();
1572 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner), 1578 audio_manager_ = media::AudioManager::Create(std::move(audio_task_runner),
1573 std::move(worker_task_runner), 1579 std::move(worker_task_runner),
1574 MediaInternals::GetInstance()); 1580 MediaInternals::GetInstance());
1575 } 1581 }
1576 CHECK(audio_manager_); 1582 CHECK(audio_manager_);
1577 } 1583 }
1578 1584
1579 } // namespace content 1585 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698