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

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

Issue 2656013005: Better crash stacktraces for ExtensionFunction bad messages. (Closed)
Patch Set: Created 3 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
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 <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
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
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
OLDNEW
« no previous file with comments | « no previous file | extensions/browser/extension_function.h » ('j') | extensions/browser/extension_function.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698