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

Side by Side Diff: ipc/ipc_channel_win.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/ipc_channel_unittest.cc ('k') | ipc/ipc_fuzzing_tests.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ipc_channel_win.h" 5 #include "ipc/ipc_channel_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 bool ChannelWin::WillDispatchInputMessage(Message* msg) { 154 bool ChannelWin::WillDispatchInputMessage(Message* msg) {
155 // Make sure we get a hello when client validation is required. 155 // Make sure we get a hello when client validation is required.
156 if (validate_client_) 156 if (validate_client_)
157 return IsHelloMessage(*msg); 157 return IsHelloMessage(*msg);
158 return true; 158 return true;
159 } 159 }
160 160
161 void ChannelWin::HandleInternalMessage(const Message& msg) { 161 void ChannelWin::HandleInternalMessage(const Message& msg) {
162 DCHECK_EQ(msg.type(), static_cast<unsigned>(Channel::HELLO_MESSAGE_TYPE)); 162 DCHECK_EQ(msg.type(), static_cast<unsigned>(Channel::HELLO_MESSAGE_TYPE));
163 // The hello message contains one parameter containing the PID. 163 // The hello message contains one parameter containing the PID.
164 PickleIterator it(msg); 164 base::PickleIterator it(msg);
165 int32 claimed_pid; 165 int32 claimed_pid;
166 bool failed = !it.ReadInt(&claimed_pid); 166 bool failed = !it.ReadInt(&claimed_pid);
167 167
168 if (!failed && validate_client_) { 168 if (!failed && validate_client_) {
169 int32 secret; 169 int32 secret;
170 failed = it.ReadInt(&secret) ? (secret != client_secret_) : true; 170 failed = it.ReadInt(&secret) ? (secret != client_secret_) : true;
171 } 171 }
172 172
173 if (failed) { 173 if (failed) {
174 NOTREACHED(); 174 NOTREACHED();
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 int secret; 501 int secret;
502 do { // Guarantee we get a non-zero value. 502 do { // Guarantee we get a non-zero value.
503 secret = base::RandInt(0, std::numeric_limits<int>::max()); 503 secret = base::RandInt(0, std::numeric_limits<int>::max());
504 } while (secret == 0); 504 } while (secret == 0);
505 505
506 id.append(GenerateUniqueRandomChannelID()); 506 id.append(GenerateUniqueRandomChannelID());
507 return id.append(base::StringPrintf("\\%d", secret)); 507 return id.append(base::StringPrintf("\\%d", secret));
508 } 508 }
509 509
510 } // namespace IPC 510 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_unittest.cc ('k') | ipc/ipc_fuzzing_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698