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

Side by Side Diff: extensions/browser/api/hid/hid_api.cc

Issue 771393002: Migrate HidServiceLinux and HidConnectionLinux to BrowserThread::UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switched to an embedded thread checker. Created 6 years 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 | « device/hid/hid_service_unittest.cc ('k') | extensions/browser/api/hid/hid_apitest.cc » ('j') | 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 "extensions/browser/api/hid/hid_api.h" 5 #include "extensions/browser/api/hid/hid_api.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "device/core/device_client.h" 10 #include "device/core/device_client.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 } // namespace 57 } // namespace
58 58
59 namespace extensions { 59 namespace extensions {
60 60
61 HidAsyncApiFunction::HidAsyncApiFunction() 61 HidAsyncApiFunction::HidAsyncApiFunction()
62 : device_manager_(NULL), connection_manager_(NULL) {} 62 : device_manager_(NULL), connection_manager_(NULL) {}
63 63
64 HidAsyncApiFunction::~HidAsyncApiFunction() {} 64 HidAsyncApiFunction::~HidAsyncApiFunction() {}
65 65
66 bool HidAsyncApiFunction::PrePrepare() { 66 bool HidAsyncApiFunction::PrePrepare() {
67 #if defined(OS_MACOSX) 67 #if defined(OS_WIN)
68 // Migration from FILE thread to UI thread. OS X gets it first. 68 // TODO(reillyg): Migrate Windows backend from FILE thread to UI thread.
69 set_work_thread_id(content::BrowserThread::FILE);
70 #else
69 set_work_thread_id(content::BrowserThread::UI); 71 set_work_thread_id(content::BrowserThread::UI);
70 #else
71 // TODO(reillyg): Migrate Linux/CrOS and Windows as well.
72 set_work_thread_id(content::BrowserThread::FILE);
73 #endif 72 #endif
74 device_manager_ = HidDeviceManager::Get(browser_context()); 73 device_manager_ = HidDeviceManager::Get(browser_context());
75 if (!device_manager_) { 74 if (!device_manager_) {
76 return false; 75 return false;
77 } 76 }
78 connection_manager_ = 77 connection_manager_ =
79 ApiResourceManager<HidConnectionResource>::Get(browser_context()); 78 ApiResourceManager<HidConnectionResource>::Get(browser_context());
80 if (!connection_manager_) { 79 if (!connection_manager_) {
81 return false; 80 return false;
82 } 81 }
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 343
345 void HidSendFeatureReportFunction::OnFinished(bool success) { 344 void HidSendFeatureReportFunction::OnFinished(bool success) {
346 if (!success) { 345 if (!success) {
347 CompleteWithError(kErrorTransfer); 346 CompleteWithError(kErrorTransfer);
348 return; 347 return;
349 } 348 }
350 AsyncWorkCompleted(); 349 AsyncWorkCompleted();
351 } 350 }
352 351
353 } // namespace extensions 352 } // namespace extensions
OLDNEW
« no previous file with comments | « device/hid/hid_service_unittest.cc ('k') | extensions/browser/api/hid/hid_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698