Codebase list mozc / 881be76
Protobuf file location refactoring part 4. This is a series of CLs to move *.proto files into protocol/ directory. Following file will be moved in this CL. - state.proto This is just a refactoring. No user-visible behavior change should occur. BUG=none TEST=unittest Hiroyuki Komatsu authored 8 years ago Yohei Yukawa committed 8 years ago
8 changed file(s) with 109 addition(s) and 108 deletion(s). Raw diff Collapse all Expand all
00 MAJOR=2
11 MINOR=17
2 BUILD=2102
2 BUILD=2103
33 REVISION=102
44 # NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
55 # downloaded by NaCl Mozc.
120120 'dependencies': [
121121 '../config/config.gyp:config_protocol',
122122 '../protobuf/protobuf.gyp:protobuf',
123 '../protocol/protocol.gyp:commands_proto',
123 'commands_proto',
124124 'genproto_renderer_proto#host'
125125 ],
126126 'export_dependent_settings': [
127127 'genproto_renderer_proto#host',
128 ],
129 },
130 {
131 'target_name': 'genproto_state_proto',
132 'type': 'none',
133 'toolsets': ['host'],
134 'sources': [
135 'state.proto',
136 ],
137 'includes': [
138 '../protobuf/genproto.gypi',
139 ],
140 'dependencies': [
141 'genproto_candidates_proto',
142 'genproto_commands_proto',
143 ],
144 },
145 {
146 'target_name': 'state_proto',
147 'type': 'static_library',
148 'hard_dependency': 1,
149 'sources': [
150 '<(proto_out_dir)/<(relative_dir)/state.pb.cc',
151 ],
152 'dependencies': [
153 '../protobuf/protobuf.gyp:protobuf',
154 'candidates_proto',
155 'commands_proto',
156 'genproto_state_proto#host',
157 ],
158 'export_dependent_settings': [
159 'genproto_state_proto#host',
128160 ],
129161 },
130162 {
0 // Copyright 2010-2015, Google Inc.
1 // All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 // * Neither the name of Google Inc. nor the names of its
14 // contributors may be used to endorse or promote products derived from
15 // this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 // Protocol messages for session state
30 syntax = "proto2";
31
32 import "protocol/candidates.proto";
33 import "protocol/commands.proto";
34
35 package mozc.protocol;
36
37 message SessionState {
38 // session id
39 required uint64 id = 1;
40 // session created time
41 optional uint64 created_time = 2;
42
43 // whether session is just after commitment
44 optional bool committed = 3 [default = false];
45
46 optional uint64 start_preedit_time = 10;
47 optional uint64 start_conversion_window_time = 11;
48 optional uint64 start_prediction_window_time = 12;
49 optional uint64 start_suggestion_window_time = 13;
50 optional uint64 start_infolist_window_time = 14;
51
52 // last preedit state
53 optional mozc.commands.Preedit preedit = 20;
54
55 // last candidates state
56 optional mozc.commands.Candidates candidates = 21;
57
58 // last candidates result
59 optional mozc.commands.Result result = 23;
60
61 // last request
62 optional mozc.commands.Request request = 24;
63
64 optional mozc.commands.Context.InputFieldType input_field_type = 25;
65 };
113113 'dependencies': [
114114 '../base/base.gyp:base',
115115 '../config/config.gyp:stats_config_util',
116 '../protocol/protocol.gyp:state_proto',
116117 '../usage_stats/usage_stats_base.gyp:usage_stats',
117118 '../usage_stats/usage_stats_base.gyp:usage_stats_protocol',
118 'session_base.gyp:state_proto',
119119 ],
120120 },
121121 {
141141 '../storage/storage.gyp:storage',
142142 ]
143143 },
144 {
145 'target_name': 'genproto_state_proto',
146 'type': 'none',
147 'toolsets': ['host'],
148 'sources': [
149 'state.proto',
150 ],
151 'includes': [
152 '../protobuf/genproto.gypi',
153 ],
154 'dependencies': [
155 '../protocol/protocol.gyp:genproto_candidates_proto',
156 '../protocol/protocol.gyp:genproto_commands_proto',
157 ],
158 },
159 {
160 'target_name': 'state_proto',
161 'type': 'static_library',
162 'hard_dependency': 1,
163 'sources': [
164 '<(proto_out_dir)/<(relative_dir)/state.pb.cc',
165 ],
166 'dependencies': [
167 '../protobuf/protobuf.gyp:protobuf',
168 '../protocol/protocol.gyp:candidates_proto',
169 '../protocol/protocol.gyp:commands_proto',
170 'genproto_state_proto#host',
171 ],
172 'export_dependent_settings': [
173 'genproto_state_proto#host',
174 ],
175 },
176144 ],
177145 }
4242 #include "base/util.h"
4343 #include "config/stats_config_util.h"
4444 #include "protocol/commands.pb.h"
45 #include "session/state.pb.h"
45 #include "protocol/state.pb.h"
4646 #include "usage_stats/usage_stats.h"
4747 #include "usage_stats/usage_stats.pb.h"
4848
49 using mozc::protocol::SessionState;
4950 using mozc::usage_stats::UsageStats;
5051
5152 namespace mozc {
3434 #include <vector>
3535
3636 #include "base/port.h"
37 #include "protocol/state.pb.h"
3738 #include "session/session_observer_interface.h"
38 #include "session/state.pb.h"
3939 #include "usage_stats/usage_stats.h"
4040
4141 namespace mozc {
8282
8383 void EvalCreateSession(const commands::Input &input,
8484 const commands::Output &output,
85 map<uint64, SessionState> *states);
85 map<uint64, protocol::SessionState> *states);
8686 // Update state and update stats using input and output.
8787 void UpdateState(const commands::Input &input,
8888 const commands::Output &output,
89 SessionState *state);
89 protocol::SessionState *state);
9090 // Update client side stats.
9191 void UpdateClientSideStats(const commands::Input &input,
92 SessionState *state);
92 protocol::SessionState *state);
9393 // Evals touch events and saves touch event stats.
9494 void LogTouchEvent(const commands::Input &input,
9595 const commands::Output &output,
96 const SessionState &state);
96 const protocol::SessionState &state);
9797 // Stores KeyTouch message to TouchEventStats.
9898 void StoreTouchEventStats(
9999 const commands::Input_TouchEvent &touch_event,
100100 usage_stats::TouchEventStatsMap *touch_event_stats_map);
101101
102 map<uint64, SessionState> states_;
102 map<uint64, protocol::SessionState> states_;
103103 UsageCache usage_cache_;
104104
105105 // last_touchevents_ is used to keep the touch_events of last SEND_KEY
+0
-66
src/session/state.proto less more
0 // Copyright 2010-2015, Google Inc.
1 // All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 // * Neither the name of Google Inc. nor the names of its
14 // contributors may be used to endorse or promote products derived from
15 // this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 // Protocol messages for session state
30 syntax = "proto2";
31
32 import "protocol/candidates.proto";
33 import "protocol/commands.proto";
34
35 package mozc.session;
36
37 message SessionState {
38 // session id
39 required uint64 id = 1;
40 // session created time
41 optional uint64 created_time = 2;
42
43 // whether session is just after commitment
44 optional bool committed = 3 [default = false];
45
46 optional uint64 start_preedit_time = 10;
47 optional uint64 start_conversion_window_time = 11;
48 optional uint64 start_prediction_window_time = 12;
49 optional uint64 start_suggestion_window_time = 13;
50 optional uint64 start_infolist_window_time = 14;
51
52 // last preedit state
53 optional mozc.commands.Preedit preedit = 20;
54
55 // last candidates state
56 optional mozc.commands.Candidates candidates = 21;
57
58 // last candidates result
59 optional mozc.commands.Result result = 23;
60
61 // last request
62 optional mozc.commands.Request request = 24;
63
64 optional mozc.commands.Context.InputFieldType input_field_type = 25;
65 };