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

Side by Side Diff: ipc/attachment_broker_privileged_win_unittest.cc

Issue 1575433002: Fix Win Clang -Wpessimizing-move error (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | no next file » | 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 if (!success) { 95 if (!success) {
96 LOG(INFO) << "Failed to deserialize message."; 96 LOG(INFO) << "Failed to deserialize message.";
97 return nullptr; 97 return nullptr;
98 } 98 }
99 99
100 base::SharedMemoryHandle handle = base::get<0>(p); 100 base::SharedMemoryHandle handle = base::get<0>(p);
101 scoped_ptr<base::SharedMemory> shared_memory( 101 scoped_ptr<base::SharedMemory> shared_memory(
102 new base::SharedMemory(handle, false)); 102 new base::SharedMemory(handle, false));
103 103
104 shared_memory->Map(size); 104 shared_memory->Map(size);
105 return std::move(shared_memory); 105 return shared_memory;
106 } 106 }
107 107
108 // |message| must be deserializable as a TestTwoHandleWinMsg. Returns the 108 // |message| must be deserializable as a TestTwoHandleWinMsg. Returns the
109 // HANDLE, or nullptr if deserialization failed. 109 // HANDLE, or nullptr if deserialization failed.
110 bool GetHandleFromTestTwoHandleWinMsg(const IPC::Message& message, 110 bool GetHandleFromTestTwoHandleWinMsg(const IPC::Message& message,
111 HANDLE* h1, 111 HANDLE* h1,
112 HANDLE* h2) { 112 HANDLE* h2) {
113 // Expect a message with a brokered attachment. 113 // Expect a message with a brokered attachment.
114 if (!message.HasBrokerableAttachments()) { 114 if (!message.HasBrokerableAttachments()) {
115 LOG(INFO) << "Message missing brokerable attachment."; 115 LOG(INFO) << "Message missing brokerable attachment.";
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 memcmp(shared_memory->memory(), kDataBuffer, strlen(kDataBuffer)) == 0; 643 memcmp(shared_memory->memory(), kDataBuffer, strlen(kDataBuffer)) == 0;
644 SendControlMessage(sender, success); 644 SendControlMessage(sender, success);
645 } 645 }
646 646
647 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(SendSharedMemoryHandle) { 647 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(SendSharedMemoryHandle) {
648 return CommonPrivilegedProcessMain(&SendSharedMemoryHandleCallback, 648 return CommonPrivilegedProcessMain(&SendSharedMemoryHandleCallback,
649 "SendSharedMemoryHandle"); 649 "SendSharedMemoryHandle");
650 } 650 }
651 651
652 } // namespace 652 } // namespace
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698