diff options
author | kmarshall <kmarshall@chromium.org> | 2015-12-04 10:01:38 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-04 18:03:14 +0000 |
commit | 86b0cb8806c63e1628bb2dfe57fd0a2140087a20 (patch) | |
tree | 991d11d41bef0399234fb01d105222fb42789f1d /blimp/net | |
parent | ed075db08e60f44fe070f33fc02024fc98af6559 (diff) | |
download | chromium_src-86b0cb8806c63e1628bb2dfe57fd0a2140087a20.zip chromium_src-86b0cb8806c63e1628bb2dfe57fd0a2140087a20.tar.gz chromium_src-86b0cb8806c63e1628bb2dfe57fd0a2140087a20.tar.bz2 |
Add CreateBlimpMessage helper function library.
This suite of helper methods to simplify the repetitive task of creating
new BlimpMessages, initializing them, and extracting type-specific
inner messages.
Add library calls to existing Blimp code.
R=dtrainor@chromium.org
BUG=
Review URL: https://codereview.chromium.org/1498893002
Cr-Commit-Position: refs/heads/master@{#363246}
Diffstat (limited to 'blimp/net')
-rw-r--r-- | blimp/net/BUILD.gn | 1 | ||||
-rw-r--r-- | blimp/net/input_message_generator.cc | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/blimp/net/BUILD.gn b/blimp/net/BUILD.gn index 943c34a..bd73b7a 100644 --- a/blimp/net/BUILD.gn +++ b/blimp/net/BUILD.gn @@ -51,6 +51,7 @@ component("blimp_net") { deps = [ "//base", + "//blimp/common:blimp_common", "//blimp/common/proto", "//net", ] diff --git a/blimp/net/input_message_generator.cc b/blimp/net/input_message_generator.cc index ae0eef0..507690c 100644 --- a/blimp/net/input_message_generator.cc +++ b/blimp/net/input_message_generator.cc @@ -5,6 +5,7 @@ #include "blimp/net/input_message_generator.h" #include "base/logging.h" +#include "blimp/common/create_blimp_message.h" #include "blimp/common/proto/blimp_message.pb.h" #include "blimp/common/proto/input.pb.h" #include "blimp/net/blimp_message_processor.h" @@ -113,9 +114,8 @@ InputMessageGenerator::~InputMessageGenerator() {} scoped_ptr<BlimpMessage> InputMessageGenerator::GenerateMessage( const blink::WebInputEvent& event) { - scoped_ptr<BlimpMessage> message(new BlimpMessage); - message->set_type(BlimpMessage::INPUT); - InputMessage* details = message->mutable_input(); + InputMessage* details; + scoped_ptr<BlimpMessage> message = CreateBlimpMessage(&details); switch (event.type) { case blink::WebInputEvent::Type::GestureScrollBegin: |