OLD | NEW |
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 Loading... |
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 |
OLD | NEW |