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

Unified Diff: services/shell/public/cpp/shell_connection_ref.h

Issue 2131493002: ShellConnection -> ServiceContext (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@st
Patch Set: . Created 4 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 | « services/shell/public/cpp/shell_connection.h ('k') | services/shell/runner/child/test_native_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/shell/public/cpp/shell_connection_ref.h
diff --git a/services/shell/public/cpp/shell_connection_ref.h b/services/shell/public/cpp/shell_connection_ref.h
deleted file mode 100644
index b22e12ea3d6755a0f78011baa405374ca61e9984..0000000000000000000000000000000000000000
--- a/services/shell/public/cpp/shell_connection_ref.h
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2016 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 SERVICES_SHELL_PUBLIC_CPP_SHELL_CONNECTION_REF_H_
-#define SERVICES_SHELL_PUBLIC_CPP_SHELL_CONNECTION_REF_H_
-
-#include <memory>
-
-#include "base/callback.h"
-#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
-
-namespace shell {
-
-class ShellConnectionRefImpl;
-
-// An interface implementation can keep this object as a member variable to
-// hold a reference to the ShellConnection, keeping it alive as long as the
-// bound implementation exists.
-//
-// This class is safe to use on any thread and instances may be passed to other
-// threads. However, each instance should only be used on one thread at a time,
-// otherwise there'll be races between the AddRef resulting from cloning and
-// destruction.
-class ShellConnectionRef {
- public:
- virtual ~ShellConnectionRef() {}
-
- virtual std::unique_ptr<ShellConnectionRef> Clone() = 0;
-};
-
-class ShellConnectionRefFactory {
- public:
- // |quit_closure| is called whenever the last ref is destroyed.
- explicit ShellConnectionRefFactory(const base::Closure& quit_closure);
- ~ShellConnectionRefFactory();
-
- std::unique_ptr<ShellConnectionRef> CreateRef();
-
- bool HasNoRefs() const { return !ref_count_; }
-
- private:
- friend ShellConnectionRefImpl;
-
- // Called from ShellConnectionRefImpl.
- void AddRef();
- void Release();
-
- const base::Closure quit_closure_;
- int ref_count_ = 0;
- base::WeakPtrFactory<ShellConnectionRefFactory> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(ShellConnectionRefFactory);
-};
-
-} // namespace shell
-
-#endif // SERVICES_SHELL_PUBLIC_CPP_SHELL_CONNECTION_REF_H_
« no previous file with comments | « services/shell/public/cpp/shell_connection.h ('k') | services/shell/runner/child/test_native_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698