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

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

Issue 177003015: Pull AsyncApiFunction out of src/chrome (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
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 "chrome/browser/extensions/api/hid/hid_api.h" 5 #include "chrome/browser/extensions/api/hid/hid_api.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "chrome/browser/extensions/api/api_resource_manager.h" 10 #include "chrome/browser/extensions/api/api_resource_manager.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } // namespace 50 } // namespace
51 51
52 namespace extensions { 52 namespace extensions {
53 53
54 HidAsyncApiFunction::HidAsyncApiFunction() : manager_(NULL) { 54 HidAsyncApiFunction::HidAsyncApiFunction() : manager_(NULL) {
55 } 55 }
56 56
57 HidAsyncApiFunction::~HidAsyncApiFunction() {} 57 HidAsyncApiFunction::~HidAsyncApiFunction() {}
58 58
59 bool HidAsyncApiFunction::PrePrepare() { 59 bool HidAsyncApiFunction::PrePrepare() {
60 manager_ = ApiResourceManager<HidConnectionResource>::Get(GetProfile()); 60 manager_ = ApiResourceManager<HidConnectionResource>::Get(context());
61 if (!manager_) return false; 61 if (!manager_) return false;
62 set_work_thread_id(content::BrowserThread::FILE); 62 set_work_thread_id(content::BrowserThread::FILE);
63 return true; 63 return true;
64 } 64 }
65 65
66 bool HidAsyncApiFunction::Respond() { return error_.empty(); } 66 bool HidAsyncApiFunction::Respond() { return error_.empty(); }
67 67
68 HidConnectionResource* HidAsyncApiFunction::GetHidConnectionResource( 68 HidConnectionResource* HidAsyncApiFunction::GetHidConnectionResource(
69 int api_resource_id) { 69 int api_resource_id) {
70 return manager_->Get(extension_->id(), api_resource_id); 70 return manager_->Get(extension_->id(), api_resource_id);
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 316
317 void HidSendFeatureReportFunction::OnFinished(bool success, size_t bytes) { 317 void HidSendFeatureReportFunction::OnFinished(bool success, size_t bytes) {
318 if (!success) { 318 if (!success) {
319 CompleteWithError(kErrorTransfer); 319 CompleteWithError(kErrorTransfer);
320 return; 320 return;
321 } 321 }
322 AsyncWorkCompleted(); 322 AsyncWorkCompleted();
323 } 323 }
324 324
325 } // namespace extensions 325 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698