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

Unified Diff: sandbox/mac/mach_message_server.h

Issue 392273002: Create DispatchSourceMach to run a MACH_RECV dispatch source. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: I despise the shared_library build with a deep, deep passion Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/mac/dispatch_source_mach_unittest.cc ('k') | sandbox/mac/mach_message_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/mac/mach_message_server.h
diff --git a/sandbox/mac/mach_message_server.h b/sandbox/mac/mach_message_server.h
index ba0b2c40a06c9530c682573429900753b80390b4..95be5fb3306469bf4ad0a8ea79dcd1df1dd0d989 100644
--- a/sandbox/mac/mach_message_server.h
+++ b/sandbox/mac/mach_message_server.h
@@ -5,15 +5,17 @@
#ifndef SANDBOX_MAC_MACH_MESSAGE_SERVER_H_
#define SANDBOX_MAC_MACH_MESSAGE_SERVER_H_
-#include <dispatch/dispatch.h>
#include <mach/mach.h>
#include "base/mac/scoped_mach_port.h"
#include "base/mac/scoped_mach_vm.h"
+#include "base/memory/scoped_ptr.h"
#include "sandbox/mac/message_server.h"
namespace sandbox {
+class DispatchSourceMach;
+
// A Mach message server that operates a receive port. Messages are received
// and then passed to the MessageDemuxer for handling. The Demuxer
// can use the server class to send a reply, forward the message to a
@@ -53,16 +55,6 @@ class MachMessageServer : public MessageServer {
// The Mach port on which the server is receiving requests.
base::mac::ScopedMachReceiveRight server_port_;
- // The dispatch queue used to service the server_source_.
- dispatch_queue_t server_queue_;
-
- // A MACH_RECV dispatch source for the server_port_.
- dispatch_source_t server_source_;
-
- // Semaphore used to wait on the |server_source_|'s cancellation in the
- // destructor.
- dispatch_semaphore_t source_canceled_;
-
// The size of the two message buffers below.
const mach_msg_size_t buffer_size_;
@@ -70,6 +62,9 @@ class MachMessageServer : public MessageServer {
base::mac::ScopedMachVM request_buffer_;
base::mac::ScopedMachVM reply_buffer_;
+ // MACH_RECV dispatch source that handles the |server_port_|.
+ scoped_ptr<DispatchSourceMach> dispatch_source_;
+
// Whether or not ForwardMessage() was called during ReceiveMessage().
bool did_forward_message_;
};
« no previous file with comments | « sandbox/mac/dispatch_source_mach_unittest.cc ('k') | sandbox/mac/mach_message_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698