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

Side by Side Diff: ipc/handle_win.cc

Issue 1493413004: ipc: Allow attachment brokering for shared memory handles. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp1
Patch Set: Fix more tests. Created 4 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/handle_attachment_win.cc ('k') | ipc/ipc.gyp » ('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 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 "ipc/handle_win.h" 5 #include "ipc/handle_win.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 29 matching lines...) Expand all
40 return false; 40 return false;
41 BrokerableAttachment* brokerable_attachment = 41 BrokerableAttachment* brokerable_attachment =
42 static_cast<BrokerableAttachment*>(attachment.get()); 42 static_cast<BrokerableAttachment*>(attachment.get());
43 if (brokerable_attachment->GetBrokerableType() != 43 if (brokerable_attachment->GetBrokerableType() !=
44 BrokerableAttachment::WIN_HANDLE) { 44 BrokerableAttachment::WIN_HANDLE) {
45 return false; 45 return false;
46 } 46 }
47 IPC::internal::HandleAttachmentWin* handle_attachment = 47 IPC::internal::HandleAttachmentWin* handle_attachment =
48 static_cast<IPC::internal::HandleAttachmentWin*>(brokerable_attachment); 48 static_cast<IPC::internal::HandleAttachmentWin*>(brokerable_attachment);
49 r->set_handle(handle_attachment->get_handle()); 49 r->set_handle(handle_attachment->get_handle());
50 handle_attachment->reset_handle_ownership();
50 return true; 51 return true;
51 } 52 }
52 53
53 // static 54 // static
54 void ParamTraits<HandleWin>::Log(const param_type& p, std::string* l) { 55 void ParamTraits<HandleWin>::Log(const param_type& p, std::string* l) {
55 l->append(base::StringPrintf("0x%p", p.get_handle())); 56 l->append(base::StringPrintf("0x%p", p.get_handle()));
56 l->append(base::IntToString(p.get_permissions())); 57 l->append(base::IntToString(p.get_permissions()));
57 } 58 }
58 59
59 } // namespace IPC 60 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/handle_attachment_win.cc ('k') | ipc/ipc.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698