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

Side by Side Diff: base/message_loop.cc

Issue 10174048: PPAPI/NaCl: Speculative implementation for ipc_channel_nacl.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: eliminate writer thread, make reading loop tighter Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | build/all.gyp » ('j') | build/all.gyp » ('J')
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/message_loop.h" 5 #include "base/message_loop.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 message_loop_proxy_ = new base::MessageLoopProxyImpl(); 141 message_loop_proxy_ = new base::MessageLoopProxyImpl();
142 142
143 // TODO(rvargas): Get rid of the OS guards. 143 // TODO(rvargas): Get rid of the OS guards.
144 #if defined(OS_WIN) 144 #if defined(OS_WIN)
145 #define MESSAGE_PUMP_UI new base::MessagePumpForUI() 145 #define MESSAGE_PUMP_UI new base::MessagePumpForUI()
146 #define MESSAGE_PUMP_IO new base::MessagePumpForIO() 146 #define MESSAGE_PUMP_IO new base::MessagePumpForIO()
147 #elif defined(OS_MACOSX) 147 #elif defined(OS_MACOSX)
148 #define MESSAGE_PUMP_UI base::MessagePumpMac::Create() 148 #define MESSAGE_PUMP_UI base::MessagePumpMac::Create()
149 #define MESSAGE_PUMP_IO new base::MessagePumpLibevent() 149 #define MESSAGE_PUMP_IO new base::MessagePumpLibevent()
150 #elif defined(OS_NACL) 150 #elif defined(OS_NACL)
151 // Currently NaCl doesn't have a UI or an IO MessageLoop. 151 // Currently NaCl doesn't have a UI MessageLoop.
152 // TODO(abarth): Figure out if we need these. 152 // TODO(abarth): Figure out if we need this.
153 #define MESSAGE_PUMP_UI NULL 153 #define MESSAGE_PUMP_UI NULL
154 #define MESSAGE_PUMP_IO NULL 154 // ipc_channel_nacl.cc uses a worker thread to do socket reads currently, and
155 // doesn't require extra support for watching file descriptors.
156 #define MESSAGE_PUMP_IO new base::MessagePumpDefault();
155 #elif defined(OS_POSIX) // POSIX but not MACOSX. 157 #elif defined(OS_POSIX) // POSIX but not MACOSX.
156 #define MESSAGE_PUMP_UI new base::MessagePumpForUI() 158 #define MESSAGE_PUMP_UI new base::MessagePumpForUI()
157 #define MESSAGE_PUMP_IO new base::MessagePumpLibevent() 159 #define MESSAGE_PUMP_IO new base::MessagePumpLibevent()
158 #else 160 #else
159 #error Not implemented 161 #error Not implemented
160 #endif 162 #endif
161 163
162 if (type_ == TYPE_UI) { 164 if (type_ == TYPE_UI) {
163 if (message_pump_for_ui_factory_) 165 if (message_pump_for_ui_factory_)
164 pump_ = message_pump_for_ui_factory_(); 166 pump_ = message_pump_for_ui_factory_();
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 Watcher *delegate) { 796 Watcher *delegate) {
795 return pump_libevent()->WatchFileDescriptor( 797 return pump_libevent()->WatchFileDescriptor(
796 fd, 798 fd,
797 persistent, 799 persistent,
798 static_cast<base::MessagePumpLibevent::Mode>(mode), 800 static_cast<base::MessagePumpLibevent::Mode>(mode),
799 controller, 801 controller,
800 delegate); 802 delegate);
801 } 803 }
802 804
803 #endif 805 #endif
OLDNEW
« no previous file with comments | « no previous file | build/all.gyp » ('j') | build/all.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698