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

Side by Side Diff: ipc/ipc_sync_message.cc

Issue 2027303002: Migrate WaitableEvent to enum-based constructor in ipc/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@WEvent_enums
Patch Set: Created 4 years, 6 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/ipc_sync_channel_unittest.cc ('k') | ipc/ipc_sync_message_filter.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 "ipc/ipc_sync_message.h" 5 #include "ipc/ipc_sync_message.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <stack> 9 #include <stack>
10 10
11 #include "base/atomic_sequence_num.h" 11 #include "base/atomic_sequence_num.h"
12 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/synchronization/waitable_event.h" 14 #include "base/synchronization/waitable_event.h"
15 #include "build/build_config.h" 15 #include "build/build_config.h"
16 16
17 namespace { 17 namespace {
18 18
19 struct WaitableEventLazyInstanceTraits 19 struct WaitableEventLazyInstanceTraits
20 : public base::DefaultLazyInstanceTraits<base::WaitableEvent> { 20 : public base::DefaultLazyInstanceTraits<base::WaitableEvent> {
21 static base::WaitableEvent* New(void* instance) { 21 static base::WaitableEvent* New(void* instance) {
22 // Use placement new to initialize our instance in our preallocated space. 22 // Use placement new to initialize our instance in our preallocated space.
23 return new (instance) base::WaitableEvent(true, true); 23 return new (instance)
24 base::WaitableEvent(base::WaitableEvent::ResetPolicy::MANUAL,
25 base::WaitableEvent::InitialState::SIGNALED);
24 } 26 }
25 }; 27 };
26 28
27 base::LazyInstance<base::WaitableEvent, WaitableEventLazyInstanceTraits> 29 base::LazyInstance<base::WaitableEvent, WaitableEventLazyInstanceTraits>
28 dummy_event = LAZY_INSTANCE_INITIALIZER; 30 dummy_event = LAZY_INSTANCE_INITIALIZER;
29 31
30 base::StaticAtomicSequenceNumber g_next_id; 32 base::StaticAtomicSequenceNumber g_next_id;
31 33
32 } // namespace 34 } // namespace
33 35
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 135
134 return true; 136 return true;
135 } 137 }
136 138
137 139
138 bool MessageReplyDeserializer::SerializeOutputParameters(const Message& msg) { 140 bool MessageReplyDeserializer::SerializeOutputParameters(const Message& msg) {
139 return SerializeOutputParameters(msg, SyncMessage::GetDataIterator(&msg)); 141 return SerializeOutputParameters(msg, SyncMessage::GetDataIterator(&msg));
140 } 142 }
141 143
142 } // namespace IPC 144 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_sync_channel_unittest.cc ('k') | ipc/ipc_sync_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698