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

Side by Side Diff: ipc/ipc_message_utils.cc

Issue 1830853002: Make PlatformFileForTransit a class on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments from mseaborn. Created 4 years, 8 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 | « content/common/sandbox_util.cc ('k') | ipc/ipc_platform_file.h » ('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_message_utils.h" 5 #include "ipc/ipc_message_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 void ParamTraits<base::SharedMemoryHandle>::Write(base::Pickle* m, 773 void ParamTraits<base::SharedMemoryHandle>::Write(base::Pickle* m,
774 const param_type& p) { 774 const param_type& p) {
775 m->WriteBool(p.NeedsBrokering()); 775 m->WriteBool(p.NeedsBrokering());
776 776
777 if (p.NeedsBrokering()) { 777 if (p.NeedsBrokering()) {
778 HandleWin handle_win(p.GetHandle(), HandleWin::DUPLICATE); 778 HandleWin handle_win(p.GetHandle(), HandleWin::DUPLICATE);
779 ParamTraits<HandleWin>::Write(m, handle_win); 779 ParamTraits<HandleWin>::Write(m, handle_win);
780 780
781 // If the caller intended to pass ownership to the IPC stack, release a 781 // If the caller intended to pass ownership to the IPC stack, release a
782 // reference. 782 // reference.
783 if (p.OwnershipPassesToIPC()) 783 if (p.OwnershipPassesToIPC() && p.BelongsToCurrentProcess())
784 p.Close(); 784 p.Close();
785 } else { 785 } else {
786 m->WriteInt(HandleToLong(p.GetHandle())); 786 m->WriteInt(HandleToLong(p.GetHandle()));
787 } 787 }
788 } 788 }
789 789
790 bool ParamTraits<base::SharedMemoryHandle>::Read(const base::Pickle* m, 790 bool ParamTraits<base::SharedMemoryHandle>::Read(const base::Pickle* m,
791 base::PickleIterator* iter, 791 base::PickleIterator* iter,
792 param_type* r) { 792 param_type* r) {
793 bool needs_brokering; 793 bool needs_brokering;
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 return result; 1218 return result;
1219 } 1219 }
1220 1220
1221 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { 1221 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) {
1222 l->append("<MSG>"); 1222 l->append("<MSG>");
1223 } 1223 }
1224 1224
1225 #endif // OS_WIN 1225 #endif // OS_WIN
1226 1226
1227 } // namespace IPC 1227 } // namespace IPC
OLDNEW
« no previous file with comments | « content/common/sandbox_util.cc ('k') | ipc/ipc_platform_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698