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

Unified Diff: util/mach/exc_server_variants.cc

Issue 574753003: Add ExcServerSuccessfulReturnValue() and its test (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: clang-unformat Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « util/mach/exc_server_variants.h ('k') | util/mach/exc_server_variants_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: util/mach/exc_server_variants.cc
diff --git a/util/mach/exc_server_variants.cc b/util/mach/exc_server_variants.cc
index c57492f9d994d4ea59b4976180b0bd9d0e56d829..46e8588250bbce2db9afdbadcd6909f8ebe49370 100644
--- a/util/mach/exc_server_variants.cc
+++ b/util/mach/exc_server_variants.cc
@@ -20,6 +20,7 @@
#include "base/basictypes.h"
#include "base/logging.h"
#include "util/mach/exc.h"
+#include "util/mach/exception_behaviors.h"
#include "util/mach/excServer.h"
#include "util/mach/mach_exc.h"
#include "util/mach/mach_excServer.h"
@@ -247,8 +248,8 @@ bool ExcServer::MachMessageServerFunction(const mach_msg_header_t* in_header,
// in_request_1 is used for the portion of the request after the codes,
// which in theory can be variable-length. The check function will set it.
const Request* in_request_1;
- kern_return_t kr = MIGCheckRequestExceptionRaiseState(
- in_request, &in_request_1);
+ kern_return_t kr =
+ MIGCheckRequestExceptionRaiseState(in_request, &in_request_1);
if (kr != MACH_MSG_SUCCESS) {
SetReplyError(out_header, kr);
return true;
@@ -287,8 +288,8 @@ bool ExcServer::MachMessageServerFunction(const mach_msg_header_t* in_header,
// in_request_1 is used for the portion of the request after the codes,
// which in theory can be variable-length. The check function will set it.
const Request* in_request_1;
- kern_return_t kr = MIGCheckRequestExceptionRaiseStateIdentity(
- in_request, &in_request_1);
+ kern_return_t kr =
+ MIGCheckRequestExceptionRaiseStateIdentity(in_request, &in_request_1);
if (kr != MACH_MSG_SUCCESS) {
SetReplyError(out_header, kr);
return true;
@@ -382,8 +383,8 @@ bool MachExcServer::MachMessageServerFunction(
// in_request_1 is used for the portion of the request after the codes,
// which in theory can be variable-length. The check function will set it.
const Request* in_request_1;
- kern_return_t kr = MIGCheckRequestMachExceptionRaiseState(
- in_request, &in_request_1);
+ kern_return_t kr =
+ MIGCheckRequestMachExceptionRaiseState(in_request, &in_request_1);
if (kr != MACH_MSG_SUCCESS) {
SetReplyError(out_header, kr);
return true;
@@ -722,4 +723,13 @@ kern_return_t UniversalMachExcServer::CatchException(
destroy_complex_request);
}
+kern_return_t ExcServerSuccessfulReturnValue(exception_behavior_t behavior,
+ bool set_thread_state) {
+ if (!set_thread_state && ExceptionBehaviorHasState(behavior)) {
+ return MACH_RCV_PORT_DIED;
+ }
+
+ return KERN_SUCCESS;
+}
+
} // namespace crashpad
« no previous file with comments | « util/mach/exc_server_variants.h ('k') | util/mach/exc_server_variants_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698