Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: mojo/public/cpp/bindings/lib/pipe_control_message_handler.cc

Issue 2112093002: Mojo C++ bindings: Merge EncodePointers/DecodePointers into Serialize/Deserialize, respectively. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@61_array_fix
Patch Set: . Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "mojo/public/cpp/bindings/pipe_control_message_handler.h" 5 #include "mojo/public/cpp/bindings/pipe_control_message_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "mojo/public/cpp/bindings/lib/message_builder.h" 8 #include "mojo/public/cpp/bindings/lib/message_builder.h"
9 #include "mojo/public/cpp/bindings/lib/serialization.h" 9 #include "mojo/public/cpp/bindings/lib/serialization.h"
10 #include "mojo/public/cpp/bindings/lib/validation_context.h" 10 #include "mojo/public/cpp/bindings/lib/validation_context.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 56
57 return false; 57 return false;
58 } 58 }
59 59
60 bool PipeControlMessageHandler::RunOrClosePipe(Message* message) { 60 bool PipeControlMessageHandler::RunOrClosePipe(Message* message) {
61 pipe_control::internal::RunOrClosePipeMessageParams_Data* params = 61 pipe_control::internal::RunOrClosePipeMessageParams_Data* params =
62 reinterpret_cast< 62 reinterpret_cast<
63 pipe_control::internal::RunOrClosePipeMessageParams_Data*>( 63 pipe_control::internal::RunOrClosePipeMessageParams_Data*>(
64 message->mutable_payload()); 64 message->mutable_payload());
65 params->DecodePointers();
66
67 pipe_control::RunOrClosePipeMessageParamsPtr params_ptr; 65 pipe_control::RunOrClosePipeMessageParamsPtr params_ptr;
68 internal::Deserialize<pipe_control::RunOrClosePipeMessageParamsPtr>( 66 internal::Deserialize<pipe_control::RunOrClosePipeMessageParamsPtr>(
69 params, &params_ptr, &context_); 67 params, &params_ptr, &context_);
70 68
71 if (params_ptr->input->is_peer_associated_endpoint_closed_event()) { 69 if (params_ptr->input->is_peer_associated_endpoint_closed_event()) {
72 return delegate_->OnPeerAssociatedEndpointClosed( 70 return delegate_->OnPeerAssociatedEndpointClosed(
73 params_ptr->input->get_peer_associated_endpoint_closed_event()->id); 71 params_ptr->input->get_peer_associated_endpoint_closed_event()->id);
74 } 72 }
75 if (params_ptr->input->is_associated_endpoint_closed_before_sent_event()) { 73 if (params_ptr->input->is_associated_endpoint_closed_before_sent_event()) {
76 return delegate_->OnAssociatedEndpointClosedBeforeSent( 74 return delegate_->OnAssociatedEndpointClosedBeforeSent(
77 params_ptr->input->get_associated_endpoint_closed_before_sent_event() 75 params_ptr->input->get_associated_endpoint_closed_before_sent_event()
78 ->id); 76 ->id);
79 } 77 }
80 78
81 DVLOG(1) << "Unsupported command in a RunOrClosePipe message pipe control " 79 DVLOG(1) << "Unsupported command in a RunOrClosePipe message pipe control "
82 << "message. Closing the pipe."; 80 << "message. Closing the pipe.";
83 return false; 81 return false;
84 } 82 }
85 83
86 } // namespace mojo 84 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/native_struct_data.h ('k') | mojo/public/cpp/bindings/lib/pipe_control_message_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698