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

Side by Side Diff: mojo/shell/public/cpp/lazy_interface_ptr.h

Issue 1565343003: Move mojo/application/public -> mojo/shell/public (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fetcher
Patch Set: . Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_APPLICATION_PUBLIC_CPP_LAZY_INTERFACE_PTR_H_ 5 #ifndef MOJO_SHELL_PUBLIC_CPP_LAZY_INTERFACE_PTR_H_
6 #define MOJO_APPLICATION_PUBLIC_CPP_LAZY_INTERFACE_PTR_H_ 6 #define MOJO_SHELL_PUBLIC_CPP_LAZY_INTERFACE_PTR_H_
7 7
8 #include "mojo/application/public/cpp/connect.h" 8 #include "mojo/shell/public/cpp/connect.h"
9 #include "mojo/application/public/interfaces/service_provider.mojom.h" 9 #include "mojo/shell/public/interfaces/service_provider.mojom.h"
10 10
11 namespace mojo { 11 namespace mojo {
12 12
13 // An InterfacePtr that will request an implementation from a specified 13 // An InterfacePtr that will request an implementation from a specified
14 // ServiceProvider when it is first accessed with the get() method. 14 // ServiceProvider when it is first accessed with the get() method.
15 template <typename Interface> 15 template <typename Interface>
16 class LazyInterfacePtr : public InterfacePtr<Interface> { 16 class LazyInterfacePtr : public InterfacePtr<Interface> {
17 public: 17 public:
18 LazyInterfacePtr() : service_provider_(nullptr) {} 18 LazyInterfacePtr() : service_provider_(nullptr) {}
19 19
(...skipping 16 matching lines...) Expand all
36 } 36 }
37 Interface* operator->() const { return get(); } 37 Interface* operator->() const { return get(); }
38 Interface& operator*() const { return *get(); } 38 Interface& operator*() const { return *get(); }
39 39
40 private: 40 private:
41 ServiceProvider* service_provider_; 41 ServiceProvider* service_provider_;
42 }; 42 };
43 43
44 } // namespace mojo 44 } // namespace mojo
45 45
46 #endif // MOJO_APPLICATION_PUBLIC_CPP_LAZY_INTERFACE_PTR_H_ 46 #endif // MOJO_SHELL_PUBLIC_CPP_LAZY_INTERFACE_PTR_H_
OLDNEW
« no previous file with comments | « mojo/shell/public/cpp/interface_factory_impl.h ('k') | mojo/shell/public/cpp/lib/app_lifetime_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698