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

Side by Side Diff: sandbox/win/src/sharedmem_ipc_server.cc

Issue 821693003: replace COMPILE_ASSERT with static_assert in sandbox/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 5 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 | « sandbox/win/src/service_resolver_32.cc ('k') | sandbox/win/wow_helper/wow_helper.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "base/callback.h" 5 #include "base/callback.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "sandbox/win/src/sharedmem_ipc_server.h" 8 #include "sandbox/win/src/sharedmem_ipc_server.h"
9 #include "sandbox/win/src/sharedmem_ipc_client.h" 9 #include "sandbox/win/src/sharedmem_ipc_client.h"
10 #include "sandbox/win/src/sandbox.h" 10 #include "sandbox/win/src/sandbox.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 // of the message so the client cannot play dirty tricks by changing the 223 // of the message so the client cannot play dirty tricks by changing the
224 // data in the channel while the IPC is being processed. 224 // data in the channel while the IPC is being processed.
225 scoped_ptr<CrossCallParamsEx> params( 225 scoped_ptr<CrossCallParamsEx> params(
226 CrossCallParamsEx::CreateFromBuffer(ipc_buffer, 226 CrossCallParamsEx::CreateFromBuffer(ipc_buffer,
227 service_context->channel_size, 227 service_context->channel_size,
228 &output_size)); 228 &output_size));
229 if (!params.get()) 229 if (!params.get())
230 return false; 230 return false;
231 231
232 uint32 tag = params->GetTag(); 232 uint32 tag = params->GetTag();
233 COMPILE_ASSERT(0 == INVALID_TYPE, Incorrect_type_enum); 233 static_assert(0 == INVALID_TYPE, "incorrect type enum");
234 IPCParams ipc_params = {0}; 234 IPCParams ipc_params = {0};
235 ipc_params.ipc_tag = tag; 235 ipc_params.ipc_tag = tag;
236 236
237 void* args[kMaxIpcParams]; 237 void* args[kMaxIpcParams];
238 if (!GetArgs(params.get(), &ipc_params, args)) 238 if (!GetArgs(params.get(), &ipc_params, args))
239 return false; 239 return false;
240 240
241 IPCInfo ipc_info = {0}; 241 IPCInfo ipc_info = {0};
242 ipc_info.ipc_tag = tag; 242 ipc_info.ipc_tag = tag;
243 ipc_info.client_info = &service_context->target_info; 243 ipc_info.client_info = &service_context->target_info;
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 } 411 }
412 *server_pong = ::CreateEventW(NULL, FALSE, FALSE, NULL); 412 *server_pong = ::CreateEventW(NULL, FALSE, FALSE, NULL);
413 if (!::DuplicateHandle(::GetCurrentProcess(), *server_pong, target_process_, 413 if (!::DuplicateHandle(::GetCurrentProcess(), *server_pong, target_process_,
414 client_pong, kDesiredAccess, FALSE, 0)) { 414 client_pong, kDesiredAccess, FALSE, 0)) {
415 return false; 415 return false;
416 } 416 }
417 return true; 417 return true;
418 } 418 }
419 419
420 } // namespace sandbox 420 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/win/src/service_resolver_32.cc ('k') | sandbox/win/wow_helper/wow_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698