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

Unified Diff: sandbox/win/src/policy_engine_opcodes.cc

Issue 1539423002: Revert of Switch to standard integer types in sandbox/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/win/src/policy_engine_opcodes.h ('k') | sandbox/win/src/policy_engine_params.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/win/src/policy_engine_opcodes.cc
diff --git a/sandbox/win/src/policy_engine_opcodes.cc b/sandbox/win/src/policy_engine_opcodes.cc
index 8dca0d9d621034b7d9eda2688465afa8c5048b7b..dfe42c0f818e09791a31b6b36cd39fdb2eec0be3 100644
--- a/sandbox/win/src/policy_engine_opcodes.cc
+++ b/sandbox/win/src/policy_engine_opcodes.cc
@@ -4,9 +4,7 @@
#include "sandbox/win/src/policy_engine_opcodes.h"
-#include <stddef.h>
-#include <stdint.h>
-
+#include "base/basictypes.h"
#include "sandbox/win/src/sandbox_nt_types.h"
#include "sandbox/win/src/sandbox_types.h"
@@ -50,7 +48,7 @@
// Opcode OpAlwaysFalse:
// Does not require input parameter.
-PolicyOpcode* OpcodeFactory::MakeOpAlwaysFalse(uint32_t options) {
+PolicyOpcode* OpcodeFactory::MakeOpAlwaysFalse(uint32 options) {
return MakeBase(OP_ALWAYS_FALSE, options, -1);
}
@@ -65,7 +63,7 @@
// Opcode OpAlwaysTrue:
// Does not require input parameter.
-PolicyOpcode* OpcodeFactory::MakeOpAlwaysTrue(uint32_t options) {
+PolicyOpcode* OpcodeFactory::MakeOpAlwaysTrue(uint32 options) {
return MakeBase(OP_ALWAYS_TRUE, options, -1);
}
@@ -81,7 +79,8 @@
// Does not require input parameter.
// Argument 0 contains the actual action to return.
-PolicyOpcode* OpcodeFactory::MakeOpAction(EvalResult action, uint32_t options) {
+PolicyOpcode* OpcodeFactory::MakeOpAction(EvalResult action,
+ uint32 options) {
PolicyOpcode* opcode = MakeBase(OP_ACTION, options, 0);
if (NULL == opcode) return NULL;
opcode->SetArgument(0, action);
@@ -99,13 +98,13 @@
//////////////////////////////////////////////////////////////////////////////
// Opcode OpNumberMatch:
-// Requires a uint32_t or void* in selected_param
+// Requires a uint32 or void* in selected_param
// Argument 0 is the stored number to match.
// Argument 1 is the C++ type of the 0th argument.
-PolicyOpcode* OpcodeFactory::MakeOpNumberMatch(int16_t selected_param,
- uint32_t match,
- uint32_t options) {
+PolicyOpcode* OpcodeFactory::MakeOpNumberMatch(int16 selected_param,
+ uint32 match,
+ uint32 options) {
PolicyOpcode* opcode = MakeBase(OP_NUMBER_MATCH, options, selected_param);
if (NULL == opcode) return NULL;
opcode->SetArgument(0, match);
@@ -113,9 +112,9 @@
return opcode;
}
-PolicyOpcode* OpcodeFactory::MakeOpVoidPtrMatch(int16_t selected_param,
+PolicyOpcode* OpcodeFactory::MakeOpVoidPtrMatch(int16 selected_param,
const void* match,
- uint32_t options) {
+ uint32 options) {
PolicyOpcode* opcode = MakeBase(OP_NUMBER_MATCH, options, selected_param);
if (NULL == opcode) return NULL;
opcode->SetArgument(0, match);
@@ -127,9 +126,9 @@
EvalResult OpcodeEval<OP_NUMBER_MATCH>(PolicyOpcode* opcode,
const ParameterSet* param,
MatchContext* context) {
- uint32_t value_uint32 = 0;
+ uint32 value_uint32 = 0;
if (param->Get(&value_uint32)) {
- uint32_t match_uint32 = 0;
+ uint32 match_uint32 = 0;
opcode->GetArgument(0, &match_uint32);
return (match_uint32 != value_uint32)? EVAL_FALSE : EVAL_TRUE;
} else {
@@ -145,14 +144,14 @@
//////////////////////////////////////////////////////////////////////////////
// Opcode OpNumberMatchRange
-// Requires a uint32_t in selected_param.
+// Requires a uint32 in selected_param.
// Argument 0 is the stored lower bound to match.
// Argument 1 is the stored upper bound to match.
-PolicyOpcode* OpcodeFactory::MakeOpNumberMatchRange(int16_t selected_param,
- uint32_t lower_bound,
- uint32_t upper_bound,
- uint32_t options) {
+PolicyOpcode* OpcodeFactory::MakeOpNumberMatchRange(int16 selected_param,
+ uint32 lower_bound,
+ uint32 upper_bound,
+ uint32 options) {
if (lower_bound > upper_bound) {
return NULL;
}
@@ -168,11 +167,11 @@
EvalResult OpcodeEval<OP_NUMBER_MATCH_RANGE>(PolicyOpcode* opcode,
const ParameterSet* param,
MatchContext* context) {
- uint32_t value = 0;
+ uint32 value = 0;
if (!param->Get(&value)) return EVAL_ERROR;
- uint32_t lower_bound = 0;
- uint32_t upper_bound = 0;
+ uint32 lower_bound = 0;
+ uint32 upper_bound = 0;
opcode->GetArgument(0, &lower_bound);
opcode->GetArgument(1, &upper_bound);
return((lower_bound <= value) && (upper_bound >= value))?
@@ -181,12 +180,12 @@
//////////////////////////////////////////////////////////////////////////////
// Opcode OpNumberAndMatch:
-// Requires a uint32_t in selected_param.
+// Requires a uint32 in selected_param.
// Argument 0 is the stored number to match.
-PolicyOpcode* OpcodeFactory::MakeOpNumberAndMatch(int16_t selected_param,
- uint32_t match,
- uint32_t options) {
+PolicyOpcode* OpcodeFactory::MakeOpNumberAndMatch(int16 selected_param,
+ uint32 match,
+ uint32 options) {
PolicyOpcode* opcode = MakeBase(OP_NUMBER_AND_MATCH, options, selected_param);
if (NULL == opcode) return NULL;
opcode->SetArgument(0, match);
@@ -197,10 +196,10 @@
EvalResult OpcodeEval<OP_NUMBER_AND_MATCH>(PolicyOpcode* opcode,
const ParameterSet* param,
MatchContext* context) {
- uint32_t value = 0;
+ uint32 value = 0;
if (!param->Get(&value)) return EVAL_ERROR;
- uint32_t number = 0;
+ uint32 number = 0;
opcode->GetArgument(0, &number);
return (number & value)? EVAL_TRUE : EVAL_FALSE;
}
@@ -214,11 +213,11 @@
// as noted in the header file.
// Argument 3 is the string matching options.
-PolicyOpcode* OpcodeFactory::MakeOpWStringMatch(int16_t selected_param,
+PolicyOpcode* OpcodeFactory::MakeOpWStringMatch(int16 selected_param,
const wchar_t* match_str,
int start_position,
StringMatchOptions match_opts,
- uint32_t options) {
+ uint32 options) {
if (NULL == match_str) {
return NULL;
}
@@ -342,8 +341,8 @@
// OpcodeMaker (other member functions).
PolicyOpcode* OpcodeFactory::MakeBase(OpcodeID opcode_id,
- uint32_t options,
- int16_t selected_param) {
+ uint32 options,
+ int16 selected_param) {
if (memory_size() < sizeof(PolicyOpcode)) {
return NULL;
}
« no previous file with comments | « sandbox/win/src/policy_engine_opcodes.h ('k') | sandbox/win/src/policy_engine_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698