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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 scoped_ptr<IPC::AttachmentBrokerUnprivilegedWin> broker_; | 270 scoped_ptr<IPC::AttachmentBrokerUnprivilegedWin> broker_; |
271 MockObserver observer_; | 271 MockObserver observer_; |
272 }; | 272 }; |
273 | 273 |
274 // A broker which always sets the current process as the destination process | 274 // A broker which always sets the current process as the destination process |
275 // for attachments. | 275 // for attachments. |
276 class MockBroker : public IPC::AttachmentBrokerUnprivilegedWin { | 276 class MockBroker : public IPC::AttachmentBrokerUnprivilegedWin { |
277 public: | 277 public: |
278 MockBroker() {} | 278 MockBroker() {} |
279 ~MockBroker() override {} | 279 ~MockBroker() override {} |
280 bool SendAttachmentToProcess(const IPC::BrokerableAttachment* attachment, | 280 bool SendAttachmentToProcess(IPC::BrokerableAttachment* attachment, |
281 base::ProcessId destination_process) override { | 281 base::ProcessId destination_process) override { |
282 return IPC::AttachmentBrokerUnprivilegedWin::SendAttachmentToProcess( | 282 return IPC::AttachmentBrokerUnprivilegedWin::SendAttachmentToProcess( |
283 attachment, base::Process::Current().Pid()); | 283 attachment, base::Process::Current().Pid()); |
284 } | 284 } |
285 }; | 285 }; |
286 | 286 |
287 // An unprivileged process makes a file HANDLE, and writes a string to it. The | 287 // An unprivileged process makes a file HANDLE, and writes a string to it. The |
288 // file HANDLE is sent to the privileged process using the attachment broker. | 288 // file HANDLE is sent to the privileged process using the attachment broker. |
289 // The privileged process dups the HANDLE into its own HANDLE table. This test | 289 // The privileged process dups the HANDLE into its own HANDLE table. This test |
290 // checks that the file has the same contents in the privileged process. | 290 // checks that the file has the same contents in the privileged process. |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 SendControlMessage(sender, success); | 553 SendControlMessage(sender, success); |
554 } | 554 } |
555 } | 555 } |
556 | 556 |
557 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(SendHandleTwice) { | 557 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(SendHandleTwice) { |
558 return CommonPrivilegedProcessMain(&SendHandleTwiceCallback, | 558 return CommonPrivilegedProcessMain(&SendHandleTwiceCallback, |
559 "SendHandleTwice"); | 559 "SendHandleTwice"); |
560 } | 560 } |
561 | 561 |
562 } // namespace | 562 } // namespace |
OLD | NEW |