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

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

Issue 1955123003: Mojo C++ bindings: switch the remaining callsites of the old serialization interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@24_union_and_others
Patch Set: Created 4 years, 7 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/lib/pipe_control_message_handler.h" 5 #include "mojo/public/cpp/bindings/lib/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/pipe_control_message_handler_delegate.h" 9 #include "mojo/public/cpp/bindings/lib/pipe_control_message_handler_delegate.h"
10 #include "mojo/public/cpp/bindings/lib/serialization.h"
10 #include "mojo/public/cpp/bindings/lib/validation_util.h" 11 #include "mojo/public/cpp/bindings/lib/validation_util.h"
11 #include "mojo/public/interfaces/bindings/pipe_control_messages.mojom.h" 12 #include "mojo/public/interfaces/bindings/pipe_control_messages.mojom.h"
12 13
13 namespace mojo { 14 namespace mojo {
14 namespace internal { 15 namespace internal {
15 16
16 PipeControlMessageHandler::PipeControlMessageHandler( 17 PipeControlMessageHandler::PipeControlMessageHandler(
17 PipeControlMessageHandlerDelegate* delegate) 18 PipeControlMessageHandlerDelegate* delegate)
18 : delegate_(delegate) {} 19 : delegate_(delegate) {}
19 20
(...skipping 27 matching lines...) Expand all
47 } 48 }
48 49
49 bool PipeControlMessageHandler::RunOrClosePipe(Message* message) { 50 bool PipeControlMessageHandler::RunOrClosePipe(Message* message) {
50 pipe_control::internal::RunOrClosePipeMessageParams_Data* params = 51 pipe_control::internal::RunOrClosePipeMessageParams_Data* params =
51 reinterpret_cast< 52 reinterpret_cast<
52 pipe_control::internal::RunOrClosePipeMessageParams_Data*>( 53 pipe_control::internal::RunOrClosePipeMessageParams_Data*>(
53 message->mutable_payload()); 54 message->mutable_payload());
54 params->DecodePointers(); 55 params->DecodePointers();
55 56
56 pipe_control::RunOrClosePipeMessageParamsPtr params_ptr; 57 pipe_control::RunOrClosePipeMessageParamsPtr params_ptr;
57 Deserialize_(params, &params_ptr, nullptr); 58 Deserialize<pipe_control::RunOrClosePipeMessageParamsPtr>(params, &params_ptr,
59 &context_);
58 60
59 if (params_ptr->input->is_peer_associated_endpoint_closed_event()) { 61 if (params_ptr->input->is_peer_associated_endpoint_closed_event()) {
60 return delegate_->OnPeerAssociatedEndpointClosed( 62 return delegate_->OnPeerAssociatedEndpointClosed(
61 params_ptr->input->get_peer_associated_endpoint_closed_event()->id); 63 params_ptr->input->get_peer_associated_endpoint_closed_event()->id);
62 } 64 }
63 if (params_ptr->input->is_associated_endpoint_closed_before_sent_event()) { 65 if (params_ptr->input->is_associated_endpoint_closed_before_sent_event()) {
64 return delegate_->OnAssociatedEndpointClosedBeforeSent( 66 return delegate_->OnAssociatedEndpointClosedBeforeSent(
65 params_ptr->input->get_associated_endpoint_closed_before_sent_event() 67 params_ptr->input->get_associated_endpoint_closed_before_sent_event()
66 ->id); 68 ->id);
67 } 69 }
68 70
69 DVLOG(1) << "Unsupported command in a RunOrClosePipe message pipe control " 71 DVLOG(1) << "Unsupported command in a RunOrClosePipe message pipe control "
70 << "message. Closing the pipe."; 72 << "message. Closing the pipe.";
71 return false; 73 return false;
72 } 74 }
73 75
74 } // namespace internal 76 } // namespace internal
75 } // namespace mojo 77 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/pipe_control_message_handler.h ('k') | mojo/public/cpp/bindings/lib/pipe_control_message_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698