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

Side by Side Diff: chrome/common/ipc_sync_message.cc

Issue 16554: WaitableEvent (Closed)
Patch Set: Addresssing darin's comments (round 2) Created 11 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 | « chrome/common/ipc_sync_message.h ('k') | chrome/plugin/npobject_proxy.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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #endif 9 #endif
10 #include <stack> 10 #include <stack>
11 11
12 #include "base/logging.h"
13 #include "base/waitable_event.h"
12 #include "chrome/common/ipc_sync_message.h" 14 #include "chrome/common/ipc_sync_message.h"
13 #include "base/logging.h"
14 15
15 namespace IPC { 16 namespace IPC {
16 17
17 uint32 SyncMessage::next_id_ = 0; 18 uint32 SyncMessage::next_id_ = 0;
18 #define kSyncMessageHeaderSize 4 19 #define kSyncMessageHeaderSize 4
19 20
20 #if defined(OS_WIN) 21 #if defined(OS_WIN)
21 // TODO(playmobil): reinstantiate once ObjectWatcher is ported. 22 // TODO(playmobil): reinstantiate once ObjectWatcher is ported.
22 // A dummy handle used by EnableMessagePumping. 23 // A dummy handle used by EnableMessagePumping.
23 HANDLE dummy_event = ::CreateEvent(NULL, TRUE, TRUE, NULL); 24 base::WaitableEvent* dummy_event = new base::WaitableEvent(true, true);
24 #endif 25 #endif
25 26
26 SyncMessage::SyncMessage( 27 SyncMessage::SyncMessage(
27 int32 routing_id, 28 int32 routing_id,
28 uint16 type, 29 uint16 type,
29 PriorityValue priority, 30 PriorityValue priority,
30 MessageReplyDeserializer* deserializer) 31 MessageReplyDeserializer* deserializer)
31 : Message(routing_id, type, priority), 32 : Message(routing_id, type, priority),
32 deserializer_(deserializer) 33 deserializer_(deserializer),
33 #if defined(OS_WIN) 34 pump_messages_event_(NULL)
34 // TODO(playmobil): reinstantiate once ObjectWatcher is ported.
35 , pump_messages_event_(NULL)
36 #endif
37 { 35 {
38 set_sync(); 36 set_sync();
39 set_unblock(true); 37 set_unblock(true);
40 38
41 // Add synchronous message data before the message payload. 39 // Add synchronous message data before the message payload.
42 SyncHeader header; 40 SyncHeader header;
43 header.message_id = ++next_id_; 41 header.message_id = ++next_id_;
44 WriteSyncHeader(this, header); 42 WriteSyncHeader(this, header);
45 } 43 }
46 44
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 return true; 124 return true;
127 } 125 }
128 126
129 127
130 bool MessageReplyDeserializer::SerializeOutputParameters(const Message& msg) { 128 bool MessageReplyDeserializer::SerializeOutputParameters(const Message& msg) {
131 return SerializeOutputParameters(msg, SyncMessage::GetDataIterator(&msg)); 129 return SerializeOutputParameters(msg, SyncMessage::GetDataIterator(&msg));
132 } 130 }
133 131
134 } // namespace IPC 132 } // namespace IPC
135 133
OLDNEW
« no previous file with comments | « chrome/common/ipc_sync_message.h ('k') | chrome/plugin/npobject_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698