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

Side by Side Diff: mojo/system/dispatcher.h

Issue 106173003: Split mojo_system dylib into public and private (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix win Created 7 years 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 | « mojo/system/core_impl.cc ('k') | mojo/system/local_message_pipe_endpoint.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef MOJO_SYSTEM_DISPATCHER_H_ 5 #ifndef MOJO_SYSTEM_DISPATCHER_H_
6 #define MOJO_SYSTEM_DISPATCHER_H_ 6 #define MOJO_SYSTEM_DISPATCHER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/synchronization/lock.h" 12 #include "base/synchronization/lock.h"
13 #include "mojo/public/system/core.h" 13 #include "mojo/public/system/core.h"
14 #include "mojo/public/system/system_export.h" 14 #include "mojo/system/system_impl_export.h"
15 15
16 namespace mojo { 16 namespace mojo {
17 namespace system { 17 namespace system {
18 18
19 class CoreImpl; 19 class CoreImpl;
20 class Waiter; 20 class Waiter;
21 21
22 // A |Dispatcher| implements Mojo primitives that are "attached" to a particular 22 // A |Dispatcher| implements Mojo primitives that are "attached" to a particular
23 // handle. This includes most (all?) primitives except for |MojoWait...()|. This 23 // handle. This includes most (all?) primitives except for |MojoWait...()|. This
24 // object is thread-safe, with its state being protected by a single lock 24 // object is thread-safe, with its state being protected by a single lock
25 // |lock_|, which is also made available to implementation subclasses (via the 25 // |lock_|, which is also made available to implementation subclasses (via the
26 // |lock()| method). 26 // |lock()| method).
27 class MOJO_SYSTEM_EXPORT Dispatcher : 27 class MOJO_SYSTEM_IMPL_EXPORT Dispatcher :
28 public base::RefCountedThreadSafe<Dispatcher> { 28 public base::RefCountedThreadSafe<Dispatcher> {
29 public: 29 public:
30 // These methods implement the various primitives named |Mojo...()|. These 30 // These methods implement the various primitives named |Mojo...()|. These
31 // take |lock_| and handle races with |Close()|. Then they call out to 31 // take |lock_| and handle races with |Close()|. Then they call out to
32 // subclasses' |...ImplNoLock()| methods (still under |lock_|), which actually 32 // subclasses' |...ImplNoLock()| methods (still under |lock_|), which actually
33 // implement the primitives. 33 // implement the primitives.
34 // NOTE(vtl): This puts a big lock around each dispatcher (i.e., handle), and 34 // NOTE(vtl): This puts a big lock around each dispatcher (i.e., handle), and
35 // prevents the various |...ImplNoLock()|s from releasing the lock as soon as 35 // prevents the various |...ImplNoLock()|s from releasing the lock as soon as
36 // possible. If this becomes an issue, we can rethink this. 36 // possible. If this becomes an issue, we can rethink this.
37 MojoResult Close(); 37 MojoResult Close();
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 mutable base::Lock lock_; 127 mutable base::Lock lock_;
128 bool is_closed_; 128 bool is_closed_;
129 129
130 DISALLOW_COPY_AND_ASSIGN(Dispatcher); 130 DISALLOW_COPY_AND_ASSIGN(Dispatcher);
131 }; 131 };
132 132
133 } // namespace system 133 } // namespace system
134 } // namespace mojo 134 } // namespace mojo
135 135
136 #endif // MOJO_SYSTEM_DISPATCHER_H_ 136 #endif // MOJO_SYSTEM_DISPATCHER_H_
OLDNEW
« no previous file with comments | « mojo/system/core_impl.cc ('k') | mojo/system/local_message_pipe_endpoint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698