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

Side by Side Diff: ipc/ipc_sync_channel.cc

Issue 10735010: 3D Compositing in <browser>, first draft. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Use the correct baseline Created 8 years, 4 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_forwarding_message_filter.cc ('k') | 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 (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_channel.h" 5 #include "ipc/ipc_sync_channel.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/synchronization/waitable_event.h" 11 #include "base/synchronization/waitable_event.h"
12 #include "base/synchronization/waitable_event_watcher.h" 12 #include "base/synchronization/waitable_event_watcher.h"
13 #include "base/thread_task_runner_handle.h" 13 #include "base/thread_task_runner_handle.h"
14 #include "base/threading/thread_local.h" 14 #include "base/threading/thread_local.h"
15 #include "ipc/ipc_sync_message.h" 15 #include "ipc/ipc_sync_message.h"
16 16
17 #include <csignal>
18 using std::raise;
17 using base::TimeDelta; 19 using base::TimeDelta;
18 using base::TimeTicks; 20 using base::TimeTicks;
19 using base::WaitableEvent; 21 using base::WaitableEvent;
20 22
21 namespace IPC { 23 namespace IPC {
22 // When we're blocked in a Send(), we need to process incoming synchronous 24 // When we're blocked in a Send(), we need to process incoming synchronous
23 // messages right away because it could be blocking our reply (either 25 // messages right away because it could be blocking our reply (either
24 // directly from the same object we're calling, or indirectly through one or 26 // directly from the same object we're calling, or indirectly through one or
25 // more other channels). That means that in SyncContext's OnMessageReceived, 27 // more other channels). That means that in SyncContext's OnMessageReceived,
26 // we need to process sync message right away if we're blocked. However a 28 // we need to process sync message right away if we're blocked. However a
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 // Ideally we only want to watch this object when running a nested message 544 // Ideally we only want to watch this object when running a nested message
543 // loop. However, we don't know when it exits if there's another nested 545 // loop. However, we don't know when it exits if there's another nested
544 // message loop running under it or not, so we wouldn't know whether to 546 // message loop running under it or not, so we wouldn't know whether to
545 // stop or keep watching. So we always watch it, and create the event as 547 // stop or keep watching. So we always watch it, and create the event as
546 // manual reset since the object watcher might otherwise reset the event 548 // manual reset since the object watcher might otherwise reset the event
547 // when we're doing a WaitMany. 549 // when we're doing a WaitMany.
548 dispatch_watcher_.StartWatching(sync_context()->GetDispatchEvent(), this); 550 dispatch_watcher_.StartWatching(sync_context()->GetDispatchEvent(), this);
549 } 551 }
550 552
551 } // namespace IPC 553 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_forwarding_message_filter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698