| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "blimp/common/logging.h" | 5 #include "blimp/common/logging.h" |
| 6 | 6 |
| 7 #include <iostream> | 7 #include <iostream> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 AddField("render_widget_id", message.compositor().render_widget_id(), | 140 AddField("render_widget_id", message.compositor().render_widget_id(), |
| 141 output); | 141 output); |
| 142 } | 142 } |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 // Logs fields from INPUT messages. | 145 // Logs fields from INPUT messages. |
| 146 class InputLogExtractor : public LogExtractor { | 146 class InputLogExtractor : public LogExtractor { |
| 147 void ExtractFields(const BlimpMessage& message, | 147 void ExtractFields(const BlimpMessage& message, |
| 148 LogFields* output) const override { | 148 LogFields* output) const override { |
| 149 AddField("render_widget_id", message.input().render_widget_id(), output); | 149 AddField("render_widget_id", message.input().render_widget_id(), output); |
| 150 AddField("timestamp_seconds", message.input().timestamp_seconds(), output); |
| 151 switch (message.input().type()) { |
| 152 case InputMessage::Type_GestureScrollBegin: |
| 153 AddField("subtype", "GestureScrollBegin", output); |
| 154 break; |
| 155 case InputMessage::Type_GestureScrollEnd: |
| 156 AddField("subtype", "GestureScrollEnd", output); |
| 157 break; |
| 158 case InputMessage::Type_GestureScrollUpdate: |
| 159 AddField("subtype", "GestureScrollUpdate", output); |
| 160 break; |
| 161 case InputMessage::Type_GestureFlingStart: |
| 162 AddField("subtype", "GestureFlingStart", output); |
| 163 break; |
| 164 case InputMessage::Type_GestureFlingCancel: |
| 165 AddField("subtype", "GestureFlingCancel", output); |
| 166 AddField("prevent_boosting", |
| 167 message.input().gesture_fling_cancel().prevent_boosting(), |
| 168 output); |
| 169 break; |
| 170 case InputMessage::Type_GestureTap: |
| 171 AddField("subtype", "GestureTap", output); |
| 172 break; |
| 173 case InputMessage::Type_GesturePinchBegin: |
| 174 AddField("subtype", "GesturePinchBegin", output); |
| 175 break; |
| 176 case InputMessage::Type_GesturePinchEnd: |
| 177 AddField("subtype", "GesturePinchEnd", output); |
| 178 break; |
| 179 case InputMessage::Type_GesturePinchUpdate: |
| 180 AddField("subtype", "GesturePinchUpdate", output); |
| 181 break; |
| 182 default: // unknown |
| 183 break; |
| 184 } |
| 150 } | 185 } |
| 151 }; | 186 }; |
| 152 | 187 |
| 153 // Logs fields from RENDER_WIDGET messages. | 188 // Logs fields from RENDER_WIDGET messages. |
| 154 class RenderWidgetLogExtractor : public LogExtractor { | 189 class RenderWidgetLogExtractor : public LogExtractor { |
| 155 void ExtractFields(const BlimpMessage& message, | 190 void ExtractFields(const BlimpMessage& message, |
| 156 LogFields* output) const override { | 191 LogFields* output) const override { |
| 157 switch (message.render_widget().type()) { | 192 switch (message.render_widget().type()) { |
| 158 case RenderWidgetMessage::INITIALIZE: | 193 case RenderWidgetMessage::INITIALIZE: |
| 159 AddField("subtype", "INITIALIZE", output); | 194 AddField("subtype", "INITIALIZE", output); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 } | 296 } |
| 262 *out << ">"; | 297 *out << ">"; |
| 263 } | 298 } |
| 264 | 299 |
| 265 std::ostream& operator<<(std::ostream& out, const BlimpMessage& message) { | 300 std::ostream& operator<<(std::ostream& out, const BlimpMessage& message) { |
| 266 g_logger.Get().LogMessageToStream(message, &out); | 301 g_logger.Get().LogMessageToStream(message, &out); |
| 267 return out; | 302 return out; |
| 268 } | 303 } |
| 269 | 304 |
| 270 } // namespace blimp | 305 } // namespace blimp |
| OLD | NEW |