| OLD | NEW |
| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // | 28 // |
| 29 // With C++11, this is problematic since a smart pointer that uses explicit | 29 // With C++11, this is problematic since a smart pointer that uses explicit |
| 30 // operator bool won't allow this conversion, since it's not in a context (such | 30 // operator bool won't allow this conversion, since it's not in a context (such |
| 31 // as a conditional) where a contextual conversion to bool would be allowed. | 31 // as a conditional) where a contextual conversion to bool would be allowed. |
| 32 // TODO(rdevlin.cronin): restructure this code to remove the need for the | 32 // TODO(rdevlin.cronin): restructure this code to remove the need for the |
| 33 // additional macro. | 33 // additional macro. |
| 34 #ifdef NDEBUG | 34 #ifdef NDEBUG |
| 35 #define EXTENSION_FUNCTION_VALIDATE_RETURN_FALSE_ON_ERROR(test) \ | 35 #define EXTENSION_FUNCTION_VALIDATE_RETURN_FALSE_ON_ERROR(test) \ |
| 36 do { \ | 36 do { \ |
| 37 if (!(test)) { \ | 37 if (!(test)) { \ |
| 38 this->set_bad_message(true); \ | 38 this->SetBadMessage(); \ |
| 39 return false; \ | 39 return false; \ |
| 40 } \ | 40 } \ |
| 41 } while (0) | 41 } while (0) |
| 42 #else // NDEBUG | 42 #else // NDEBUG |
| 43 #define EXTENSION_FUNCTION_VALIDATE_RETURN_FALSE_ON_ERROR(test) CHECK(test) | 43 #define EXTENSION_FUNCTION_VALIDATE_RETURN_FALSE_ON_ERROR(test) CHECK(test) |
| 44 #endif // NDEBUG | 44 #endif // NDEBUG |
| 45 | 45 |
| 46 namespace hid = extensions::api::hid; | 46 namespace hid = extensions::api::hid; |
| 47 | 47 |
| 48 using device::HidConnection; | 48 using device::HidConnection; |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 | 378 |
| 379 void HidSendFeatureReportFunction::OnFinished(bool success) { | 379 void HidSendFeatureReportFunction::OnFinished(bool success) { |
| 380 if (success) { | 380 if (success) { |
| 381 Respond(NoArguments()); | 381 Respond(NoArguments()); |
| 382 } else { | 382 } else { |
| 383 Respond(Error(kErrorTransfer)); | 383 Respond(Error(kErrorTransfer)); |
| 384 } | 384 } |
| 385 } | 385 } |
| 386 | 386 |
| 387 } // namespace extensions | 387 } // namespace extensions |
| OLD | NEW |