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

Side by Side Diff: extensions/browser/api/serial/serial_service_factory.cc

Issue 2133083002: Remove all remaining traces of MessageLoopProxy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "extensions/browser/api/serial/serial_service_factory.h" 5 #include "extensions/browser/api/serial/serial_service_factory.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "content/public/browser/browser_thread.h" 9 #include "content/public/browser/browser_thread.h"
10 #include "device/serial/serial_service_impl.h" 10 #include "device/serial/serial_service_impl.h"
11 11
12 namespace extensions { 12 namespace extensions {
13 namespace { 13 namespace {
14 const base::Callback<void( 14 const base::Callback<void(
15 mojo::InterfaceRequest<device::serial::SerialService>)>* 15 mojo::InterfaceRequest<device::serial::SerialService>)>*
16 g_serial_service_test_factory = nullptr; 16 g_serial_service_test_factory = nullptr;
17 } 17 }
18 18
19 void BindToSerialServiceRequest( 19 void BindToSerialServiceRequest(
20 mojo::InterfaceRequest<device::serial::SerialService> request) { 20 mojo::InterfaceRequest<device::serial::SerialService> request) {
21 if (g_serial_service_test_factory) { 21 if (g_serial_service_test_factory) {
22 g_serial_service_test_factory->Run(std::move(request)); 22 g_serial_service_test_factory->Run(std::move(request));
23 return; 23 return;
24 } 24 }
25 device::SerialServiceImpl::CreateOnMessageLoop( 25 device::SerialServiceImpl::CreateOnMessageLoop(
26 content::BrowserThread::GetMessageLoopProxyForThread( 26 content::BrowserThread::GetTaskRunnerForThread(
27 content::BrowserThread::FILE), 27 content::BrowserThread::FILE),
28 content::BrowserThread::GetMessageLoopProxyForThread( 28 content::BrowserThread::GetTaskRunnerForThread(
29 content::BrowserThread::IO), 29 content::BrowserThread::IO),
30 content::BrowserThread::GetMessageLoopProxyForThread( 30 content::BrowserThread::GetTaskRunnerForThread(
31 content::BrowserThread::UI), 31 content::BrowserThread::UI),
32 std::move(request)); 32 std::move(request));
33 } 33 }
34 34
35 void SetSerialServiceFactoryForTest(const base::Callback< 35 void SetSerialServiceFactoryForTest(const base::Callback<
36 void(mojo::InterfaceRequest<device::serial::SerialService>)>* callback) { 36 void(mojo::InterfaceRequest<device::serial::SerialService>)>* callback) {
37 g_serial_service_test_factory = callback; 37 g_serial_service_test_factory = callback;
38 } 38 }
39 39
40 } // namespace extensions 40 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/serial/serial_connection.cc ('k') | extensions/browser/sandboxed_unpacker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698