Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/create_blimp_message.h" | 5 #include "blimp/common/create_blimp_message.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "blimp/common/proto/blimp_message.pb.h" | 9 #include "blimp/common/proto/blimp_message.pb.h" |
| 10 #include "blimp/common/proto/compositor.pb.h" | 10 #include "blimp/common/proto/compositor.pb.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 NavigationMessage** navigation_message, | 46 NavigationMessage** navigation_message, |
| 47 int target_tab_id) { | 47 int target_tab_id) { |
| 48 DCHECK(navigation_message); | 48 DCHECK(navigation_message); |
| 49 scoped_ptr<BlimpMessage> output(new BlimpMessage); | 49 scoped_ptr<BlimpMessage> output(new BlimpMessage); |
| 50 output->set_type(BlimpMessage::NAVIGATION); | 50 output->set_type(BlimpMessage::NAVIGATION); |
| 51 output->set_target_tab_id(target_tab_id); | 51 output->set_target_tab_id(target_tab_id); |
| 52 *navigation_message = output->mutable_navigation(); | 52 *navigation_message = output->mutable_navigation(); |
| 53 return output; | 53 return output; |
| 54 } | 54 } |
| 55 | 55 |
| 56 scoped_ptr<BlimpMessage> CreateBlimpMessage(ImeMessage** ime_message, | |
| 57 int target_tab_id) { | |
| 58 DCHECK(ime_message); | |
|
Wez
2016/03/18 20:51:28
nit: Why do we DCHECK the out-parameter here & in
Wez
2016/03/22 21:43:38
Pingy.
shaktisahu
2016/03/22 23:45:42
Since ime_message is a pointer to pointer, shouldn
Wez
2016/03/23 00:10:53
DCHECK makes sense where you are given a pointer t
shaktisahu
2016/03/23 01:44:13
I think DCHECK makes it easier for me to debug in
Wez
2016/03/23 23:21:25
How does it make it easier?
| |
| 59 scoped_ptr<BlimpMessage> output(new BlimpMessage); | |
| 60 output->set_type(BlimpMessage::IME); | |
| 61 output->set_target_tab_id(target_tab_id); | |
| 62 *ime_message = output->mutable_ime(); | |
| 63 return output; | |
| 64 } | |
| 65 | |
| 56 scoped_ptr<BlimpMessage> CreateBlimpMessage( | 66 scoped_ptr<BlimpMessage> CreateBlimpMessage( |
| 57 RenderWidgetMessage** render_widget_message, | 67 RenderWidgetMessage** render_widget_message, |
| 58 int target_tab_id) { | 68 int target_tab_id) { |
| 59 DCHECK(render_widget_message); | 69 DCHECK(render_widget_message); |
| 60 scoped_ptr<BlimpMessage> output(new BlimpMessage); | 70 scoped_ptr<BlimpMessage> output(new BlimpMessage); |
| 61 output->set_type(BlimpMessage::RENDER_WIDGET); | 71 output->set_type(BlimpMessage::RENDER_WIDGET); |
| 62 output->set_target_tab_id(target_tab_id); | 72 output->set_target_tab_id(target_tab_id); |
| 63 *render_widget_message = output->mutable_render_widget(); | 73 *render_widget_message = output->mutable_render_widget(); |
| 64 return output; | 74 return output; |
| 65 } | 75 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 control_message->set_type(ProtocolControlMessage::CHECKPOINT_ACK); | 108 control_message->set_type(ProtocolControlMessage::CHECKPOINT_ACK); |
| 99 | 109 |
| 100 CheckpointAckMessage* checkpoint_ack_message = | 110 CheckpointAckMessage* checkpoint_ack_message = |
| 101 control_message->mutable_checkpoint_ack(); | 111 control_message->mutable_checkpoint_ack(); |
| 102 checkpoint_ack_message->set_checkpoint_id(checkpoint_id); | 112 checkpoint_ack_message->set_checkpoint_id(checkpoint_id); |
| 103 | 113 |
| 104 return output; | 114 return output; |
| 105 } | 115 } |
| 106 | 116 |
| 107 } // namespace blimp | 117 } // namespace blimp |
| OLD | NEW |