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

Unified Diff: mojo/common/bindings_support_impl.cc

Issue 69283002: Revert "Mojo: Add BindingsSupportImpl on top of HandleWatcher" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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/common/bindings_support_impl.h ('k') | mojo/common/handle_watcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/common/bindings_support_impl.cc
diff --git a/mojo/common/bindings_support_impl.cc b/mojo/common/bindings_support_impl.cc
deleted file mode 100644
index 9cec1418a4625b8007d3603894f370575726ca8e..0000000000000000000000000000000000000000
--- a/mojo/common/bindings_support_impl.cc
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2013 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.
-
-#include "mojo/common/bindings_support_impl.h"
-
-#include "base/atomic_ref_count.h"
-#include "base/bind.h"
-#include "mojo/common/handle_watcher.h"
-
-namespace mojo {
-namespace common {
-
-// Context is used to track the number of HandleWatcher objects in use by a
-// particular BindingsSupportImpl instance.
-class BindingsSupportImpl::Context
- : public base::RefCountedThreadSafe<BindingsSupportImpl::Context> {
- public:
- void CallOnHandleReady(HandleWatcher* watcher,
- AsyncWaitCallback* callback,
- MojoResult result) {
- delete watcher;
- callback->OnHandleReady(result);
- }
-
- private:
- friend class base::RefCountedThreadSafe<Context>;
- virtual ~Context() {}
-};
-
-BindingsSupportImpl::BindingsSupportImpl()
- : context_(new Context()) {
-}
-
-BindingsSupportImpl::~BindingsSupportImpl() {
- // All HandleWatcher instances created through this interface should have
- // been destroyed.
- DCHECK(context_->HasOneRef());
-}
-
-BindingsSupport::AsyncWaitID BindingsSupportImpl::AsyncWait(
- Handle handle,
- MojoWaitFlags flags,
- AsyncWaitCallback* callback) {
- // This instance will be deleted when done or cancelled.
- HandleWatcher* watcher = new HandleWatcher();
-
- // TODO(darin): Standardize on mojo::Handle instead of MojoHandle?
- watcher->Start(handle.value,
- flags,
- MOJO_DEADLINE_INDEFINITE,
- base::Bind(&Context::CallOnHandleReady,
- context_,
- watcher,
- callback));
- return watcher;
-}
-
-void BindingsSupportImpl::CancelWait(AsyncWaitID async_wait_id) {
- HandleWatcher* watcher = static_cast<HandleWatcher*>(async_wait_id);
- delete watcher;
-}
-
-} // namespace common
-} // namespace mojo
« no previous file with comments | « mojo/common/bindings_support_impl.h ('k') | mojo/common/handle_watcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698