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

Side by Side Diff: ipc/attachment_broker_privileged_win_unittest.cc

Issue 1385143002: ipc: Update MachPortMac ownership semantics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix rebase errors. Created 5 years, 2 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/attachment_broker_privileged_win.cc ('k') | ipc/attachment_broker_unprivileged_mac.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 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
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
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
OLDNEW
« no previous file with comments | « ipc/attachment_broker_privileged_win.cc ('k') | ipc/attachment_broker_unprivileged_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698