| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |