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

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

Issue 2730333002: Make DeviceSensorService implement MainLoop::DestructionObserver (Closed)
Patch Set: Make DeviceSensorService observes IOThread to shutdown in right time. Created 3 years, 9 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 #include "content/public/browser/gpu_data_manager_observer.h" 85 #include "content/public/browser/gpu_data_manager_observer.h"
86 #include "content/public/browser/render_process_host.h" 86 #include "content/public/browser/render_process_host.h"
87 #include "content/public/browser/tracing_controller.h" 87 #include "content/public/browser/tracing_controller.h"
88 #include "content/public/common/content_client.h" 88 #include "content/public/common/content_client.h"
89 #include "content/public/common/content_features.h" 89 #include "content/public/common/content_features.h"
90 #include "content/public/common/content_switches.h" 90 #include "content/public/common/content_switches.h"
91 #include "content/public/common/main_function_params.h" 91 #include "content/public/common/main_function_params.h"
92 #include "content/public/common/result_codes.h" 92 #include "content/public/common/result_codes.h"
93 #include "device/battery/battery_status_service.h" 93 #include "device/battery/battery_status_service.h"
94 #include "device/gamepad/gamepad_service.h" 94 #include "device/gamepad/gamepad_service.h"
95 #include "device/sensors/device_sensor_service.h"
96 #include "media/audio/audio_system_impl.h" 95 #include "media/audio/audio_system_impl.h"
97 #include "media/base/media.h" 96 #include "media/base/media.h"
98 #include "media/base/user_input_monitor.h" 97 #include "media/base/user_input_monitor.h"
99 #include "media/midi/midi_service.h" 98 #include "media/midi/midi_service.h"
100 #include "mojo/edk/embedder/embedder.h" 99 #include "mojo/edk/embedder/embedder.h"
101 #include "mojo/edk/embedder/scoped_ipc_support.h" 100 #include "mojo/edk/embedder/scoped_ipc_support.h"
102 #include "net/base/network_change_notifier.h" 101 #include "net/base/network_change_notifier.h"
103 #include "net/socket/client_socket_factory.h" 102 #include "net/socket/client_socket_factory.h"
104 #include "net/ssl/ssl_config_service.h" 103 #include "net/ssl/ssl_config_service.h"
105 #include "ppapi/features/features.h" 104 #include "ppapi/features/features.h"
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1361 BrowserGpuChannelHostFactory::Terminate(); 1360 BrowserGpuChannelHostFactory::Terminate();
1362 } 1361 }
1363 } 1362 }
1364 1363
1365 // Must happen after the I/O thread is shutdown since this class lives on the 1364 // Must happen after the I/O thread is shutdown since this class lives on the
1366 // I/O thread and isn't threadsafe. 1365 // I/O thread and isn't threadsafe.
1367 { 1366 {
1368 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GamepadService"); 1367 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:GamepadService");
1369 device::GamepadService::GetInstance()->Terminate(); 1368 device::GamepadService::GetInstance()->Terminate();
1370 } 1369 }
1371 {
1372 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:SensorService");
1373 device::DeviceSensorService::GetInstance()->Shutdown();
1374 }
1375 #if !defined(OS_ANDROID) 1370 #if !defined(OS_ANDROID)
1376 { 1371 {
1377 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:BatteryStatusService"); 1372 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:BatteryStatusService");
1378 device::BatteryStatusService::GetInstance()->Shutdown(); 1373 device::BatteryStatusService::GetInstance()->Shutdown();
1379 } 1374 }
1380 #endif 1375 #endif
1381 { 1376 {
1382 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:DeleteDataSources"); 1377 TRACE_EVENT0("shutdown", "BrowserMainLoop::Subsystem:DeleteDataSources");
1383 URLDataManager::DeleteDataSources(); 1378 URLDataManager::DeleteDataSources();
1384 } 1379 }
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
1781 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE), 1776 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE),
1782 MediaInternals::GetInstance()); 1777 MediaInternals::GetInstance());
1783 } 1778 }
1784 CHECK(audio_manager_); 1779 CHECK(audio_manager_);
1785 1780
1786 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get()); 1781 audio_system_ = media::AudioSystemImpl::Create(audio_manager_.get());
1787 CHECK(audio_system_); 1782 CHECK(audio_system_);
1788 } 1783 }
1789 1784
1790 } // namespace content 1785 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | device/sensors/device_sensor_service.h » ('j') | device/sensors/device_sensor_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698