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

Side by Side Diff: ipc/ipc_message_utils.cc

Issue 9150030: Initialize IPC:ChannelHandle from existing HANDLE (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: use string16 Created 8 years, 11 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_win.cc ('k') | ipc/ipc_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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_message_utils.h" 5 #include "ipc/ipc_message_utils.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/nullable_string16.h" 10 #include "base/nullable_string16.h"
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 std::string* l) { 426 std::string* l) {
427 if (p.auto_close) { 427 if (p.auto_close) {
428 l->append(StringPrintf("FD(%d auto-close)", p.fd)); 428 l->append(StringPrintf("FD(%d auto-close)", p.fd));
429 } else { 429 } else {
430 l->append(StringPrintf("FD(%d)", p.fd)); 430 l->append(StringPrintf("FD(%d)", p.fd));
431 } 431 }
432 } 432 }
433 #endif // defined(OS_POSIX) 433 #endif // defined(OS_POSIX)
434 434
435 void ParamTraits<IPC::ChannelHandle>::Write(Message* m, const param_type& p) { 435 void ParamTraits<IPC::ChannelHandle>::Write(Message* m, const param_type& p) {
436 #if defined(OS_WIN)
437 // On Windows marshalling pipe handle is not supported.
438 DCHECK(p.pipe.handle == NULL);
439 #endif // defined (OS_WIN)
436 WriteParam(m, p.name); 440 WriteParam(m, p.name);
437 #if defined(OS_POSIX) 441 #if defined(OS_POSIX)
438 WriteParam(m, p.socket); 442 WriteParam(m, p.socket);
439 #endif 443 #endif
440 } 444 }
441 445
442 bool ParamTraits<IPC::ChannelHandle>::Read(const Message* m, void** iter, 446 bool ParamTraits<IPC::ChannelHandle>::Read(const Message* m, void** iter,
443 param_type* r) { 447 param_type* r) {
444 return ReadParam(m, iter, &r->name) 448 return ReadParam(m, iter, &r->name)
445 #if defined(OS_POSIX) 449 #if defined(OS_POSIX)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 ReadParam(m, iter, &r->routing_id) && 490 ReadParam(m, iter, &r->routing_id) &&
487 ReadParam(m, iter, &r->type) && 491 ReadParam(m, iter, &r->type) &&
488 ReadParam(m, iter, &r->flags) && 492 ReadParam(m, iter, &r->flags) &&
489 ReadParam(m, iter, &r->sent) && 493 ReadParam(m, iter, &r->sent) &&
490 ReadParam(m, iter, &r->receive) && 494 ReadParam(m, iter, &r->receive) &&
491 ReadParam(m, iter, &r->dispatch) && 495 ReadParam(m, iter, &r->dispatch) &&
492 ReadParam(m, iter, &r->params); 496 ReadParam(m, iter, &r->params);
493 } 497 }
494 498
495 } // namespace IPC 499 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_channel_win.cc ('k') | ipc/ipc_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698