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

Unified Diff: mojo/public/cpp/bindings/sync_dispatcher.h

Issue 380123002: Mojo: Eliminate SyncDispatcher in favor of WaitForIncomingMethodCall (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove old TODO comment 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 | « mojo/public/cpp/bindings/lib/sync_dispatcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/bindings/sync_dispatcher.h
diff --git a/mojo/public/cpp/bindings/sync_dispatcher.h b/mojo/public/cpp/bindings/sync_dispatcher.h
deleted file mode 100644
index 9f825bf8a6ae83be748514539d8d2527fc360c59..0000000000000000000000000000000000000000
--- a/mojo/public/cpp/bindings/sync_dispatcher.h
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef MOJO_PUBLIC_CPP_BINDINGS_SYNC_DISPATCHER_H_
-#define MOJO_PUBLIC_CPP_BINDINGS_SYNC_DISPATCHER_H_
-
-#include "mojo/public/cpp/bindings/lib/filter_chain.h"
-#include "mojo/public/cpp/bindings/lib/message_header_validator.h"
-#include "mojo/public/cpp/system/core.h"
-
-namespace mojo {
-
-class MessageReceiver;
-
-// Waits for one message to arrive on the message pipe, and dispatch it to the
-// receiver. Returns true on success, false on failure.
-//
-// NOTE: The message hasn't been validated and may be malformed!
-bool WaitForMessageAndDispatch(MessagePipeHandle handle,
- mojo::MessageReceiver* receiver);
-
-template<typename Interface> class SyncDispatcher {
- public:
- SyncDispatcher(ScopedMessagePipeHandle message_pipe, Interface* sink)
- : message_pipe_(message_pipe.Pass()) {
- stub_.set_sink(sink);
-
- filters_.Append<internal::MessageHeaderValidator>();
- filters_.Append<typename Interface::RequestValidator_>();
- filters_.SetSink(&stub_);
- }
-
- bool WaitAndDispatchOneMessage() {
- return WaitForMessageAndDispatch(message_pipe_.get(),
- filters_.GetHead());
- }
-
- private:
- ScopedMessagePipeHandle message_pipe_;
- typename Interface::Stub_ stub_;
- internal::FilterChain filters_;
-};
-
-} // namespace mojo
-
-#endif // MOJO_PUBLIC_CPP_BINDINGS_SYNC_DISPATCHER_H_
« no previous file with comments | « mojo/public/cpp/bindings/lib/sync_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698