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

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

Issue 2419723002: Move services/shell to services/service_manager (Closed)
Patch Set: rebase Created 4 years, 2 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/service_context.h ('k') | services/shell/public/cpp/service_runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/shell/public/cpp/service_context_ref.h
diff --git a/services/shell/public/cpp/service_context_ref.h b/services/shell/public/cpp/service_context_ref.h
deleted file mode 100644
index 0b81e8da80d5cd17765a02bf6ebaaba483fde39e..0000000000000000000000000000000000000000
--- a/services/shell/public/cpp/service_context_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_SERVICE_CONTEXT_REF_H_
-#define SERVICES_SHELL_PUBLIC_CPP_SERVICE_CONTEXT_REF_H_
-
-#include <memory>
-
-#include "base/callback.h"
-#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
-
-namespace shell {
-
-class ServiceContextRefImpl;
-
-// An interface implementation can keep this object as a member variable to
-// hold a reference to the ServiceContext, 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 ServiceContextRef {
- public:
- virtual ~ServiceContextRef() {}
-
- virtual std::unique_ptr<ServiceContextRef> Clone() = 0;
-};
-
-class ServiceContextRefFactory {
- public:
- // |quit_closure| is called whenever the last ref is destroyed.
- explicit ServiceContextRefFactory(const base::Closure& quit_closure);
- ~ServiceContextRefFactory();
-
- std::unique_ptr<ServiceContextRef> CreateRef();
-
- bool HasNoRefs() const { return !ref_count_; }
-
- private:
- friend ServiceContextRefImpl;
-
- // Called from ServiceContextRefImpl.
- void AddRef();
- void Release();
-
- const base::Closure quit_closure_;
- int ref_count_ = 0;
- base::WeakPtrFactory<ServiceContextRefFactory> weak_factory_;
-
- DISALLOW_COPY_AND_ASSIGN(ServiceContextRefFactory);
-};
-
-} // namespace shell
-
-#endif // SERVICES_SHELL_PUBLIC_CPP_SERVICE_CONTEXT_REF_H_
« no previous file with comments | « services/shell/public/cpp/service_context.h ('k') | services/shell/public/cpp/service_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698