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

Unified Diff: mojo/public/cpp/application/lazy_interface_ptr.h

Issue 814543006: Move //mojo/{public, edk} underneath //third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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/application/interface_factory_impl.h ('k') | mojo/public/cpp/application/lib/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/application/lazy_interface_ptr.h
diff --git a/mojo/public/cpp/application/lazy_interface_ptr.h b/mojo/public/cpp/application/lazy_interface_ptr.h
deleted file mode 100644
index a9b57dbde473546a8fadb07f61652b587dda7baf..0000000000000000000000000000000000000000
--- a/mojo/public/cpp/application/lazy_interface_ptr.h
+++ /dev/null
@@ -1,44 +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_APPLICATION_LAZY_INTERFACE_PTR_H_
-#define MOJO_PUBLIC_CPP_APPLICATION_LAZY_INTERFACE_PTR_H_
-
-#include "mojo/public/cpp/application/connect.h"
-#include "mojo/public/interfaces/application/service_provider.mojom.h"
-
-namespace mojo {
-
-template <typename Interface>
-class LazyInterfacePtr : public InterfacePtr<Interface> {
- public:
- LazyInterfacePtr() : service_provider_(nullptr) {}
-
- LazyInterfacePtr(ServiceProvider* service_provider)
- : service_provider_(service_provider) {}
-
- void set_service_provider(ServiceProvider* service_provider) {
- if (service_provider != service_provider_) {
- InterfacePtr<Interface>::reset();
- }
- service_provider_ = service_provider;
- }
-
- Interface* get() const {
- if (!InterfacePtr<Interface>::get() && service_provider_) {
- mojo::ConnectToService<Interface>(
- service_provider_, const_cast<LazyInterfacePtr<Interface>*>(this));
- }
- return InterfacePtr<Interface>::get();
- }
- Interface* operator->() const { return get(); }
- Interface& operator*() const { return *get(); }
-
- private:
- ServiceProvider* service_provider_;
-};
-
-} // namespace mojo
-
-#endif // MOJO_PUBLIC_CPP_APPLICATION_LAZY_INTERFACE_PTR_H_
« no previous file with comments | « mojo/public/cpp/application/interface_factory_impl.h ('k') | mojo/public/cpp/application/lib/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698