1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_PROFILE_RESETTER_JTL_INSTRUCTIONS_H_
6 #define CHROME_BROWSER_PROFILE_RESETTER_JTL_INSTRUCTIONS_H_
10 // These are instructions to generate binary code for JTL programs.
12 #define VALUE_FALSE std::string(1, '\x00')
13 #define VALUE_TRUE std::string(1, '\x01')
15 #define OP_NAVIGATE(key) std::string(1, '\x00') + key
16 #define OP_NAVIGATE_ANY std::string(1, '\x01')
17 #define OP_NAVIGATE_BACK std::string(1, '\x02')
18 #define OP_STORE_BOOL(name, value) std::string(1, '\x10') + name + value
19 #define OP_COMPARE_STORED_BOOL(name, value, default_value) \
20 std::string(1, '\x11') + name + value + default_value
21 #define OP_STORE_HASH(name, value) std::string(1, '\x12') + name + value
22 #define OP_COMPARE_STORED_HASH(name, value, default_value) \
23 std::string(1, '\x13') + name + value + default_value
24 #define OP_STORE_NODE_BOOL(name) std::string(1, '\x14') + name
25 #define OP_STORE_NODE_HASH(name) std::string(1, '\x15') + name
26 #define OP_STORE_NODE_REGISTERABLE_DOMAIN_HASH(name) \
27 std::string(1, '\x16') + name
28 #define OP_COMPARE_NODE_BOOL(value) std::string(1, '\x20') + value
29 #define OP_COMPARE_NODE_HASH(value) std::string(1, '\x21') + value
30 #define OP_COMPARE_NODE_HASH_NOT(value) std::string(1, '\x22') + value
31 #define OP_COMPARE_NODE_TO_STORED_BOOL(name) std::string(1, '\x23') + name
32 #define OP_COMPARE_NODE_TO_STORED_HASH(name) std::string(1, '\x24') + name
33 #define OP_COMPARE_NODE_SUBSTRING(pattern, pattern_length, pattern_sum) \
34 std::string(1, '\x25') + pattern + pattern_length + pattern_sum
35 #define OP_STOP_EXECUTING_SENTENCE std::string(1, '\x30')
36 #define OP_END_OF_SENTENCE std::string(1, '\x31')
38 #endif // CHROME_BROWSER_PROFILE_RESETTER_JTL_INSTRUCTIONS_H_