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

Side by Side Diff: ipc/mojo/ipc_mojo_bootstrap.cc

Issue 1154283003: Change most uses of Pickle to base::Pickle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « ipc/mojo/ipc_channel_mojo_unittest.cc ('k') | ipc/mojo/ipc_mojo_message_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ipc/mojo/ipc_mojo_bootstrap.h" 5 #include "ipc/mojo/ipc_mojo_bootstrap.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/process/process_handle.h" 8 #include "base/process/process_handle.h"
9 #include "ipc/ipc_message_utils.h" 9 #include "ipc/ipc_message_utils.h"
10 #include "ipc/ipc_platform_file.h" 10 #include "ipc/ipc_platform_file.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 135
136 bool MojoClientBootstrap::OnMessageReceived(const Message& message) { 136 bool MojoClientBootstrap::OnMessageReceived(const Message& message) {
137 if (state() != STATE_INITIALIZED) { 137 if (state() != STATE_INITIALIZED) {
138 set_state(STATE_ERROR); 138 set_state(STATE_ERROR);
139 LOG(ERROR) << "Got inconsistent message from server."; 139 LOG(ERROR) << "Got inconsistent message from server.";
140 return false; 140 return false;
141 } 141 }
142 142
143 PlatformFileForTransit pipe; 143 PlatformFileForTransit pipe;
144 PickleIterator iter(message); 144 base::PickleIterator iter(message);
145 if (!ParamTraits<PlatformFileForTransit>::Read(&message, &iter, &pipe)) { 145 if (!ParamTraits<PlatformFileForTransit>::Read(&message, &iter, &pipe)) {
146 LOG(WARNING) << "Failed to read a file handle from bootstrap channel."; 146 LOG(WARNING) << "Failed to read a file handle from bootstrap channel.";
147 message.set_dispatch_error(); 147 message.set_dispatch_error();
148 return false; 148 return false;
149 } 149 }
150 150
151 // Sends ACK back. 151 // Sends ACK back.
152 Send(new Message()); 152 Send(new Message());
153 set_state(STATE_READY); 153 set_state(STATE_READY);
154 delegate()->OnPipeAvailable( 154 delegate()->OnPipeAvailable(
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 int MojoBootstrap::GetClientFileDescriptor() const { 232 int MojoBootstrap::GetClientFileDescriptor() const {
233 return channel_->GetClientFileDescriptor(); 233 return channel_->GetClientFileDescriptor();
234 } 234 }
235 235
236 base::ScopedFD MojoBootstrap::TakeClientFileDescriptor() { 236 base::ScopedFD MojoBootstrap::TakeClientFileDescriptor() {
237 return channel_->TakeClientFileDescriptor(); 237 return channel_->TakeClientFileDescriptor();
238 } 238 }
239 #endif // defined(OS_POSIX) && !defined(OS_NACL) 239 #endif // defined(OS_POSIX) && !defined(OS_NACL)
240 240
241 } // namespace IPC 241 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/mojo/ipc_channel_mojo_unittest.cc ('k') | ipc/mojo/ipc_mojo_message_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698