OLD | NEW |
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_APPLICATION_IMPL_H_ | 5 #ifndef MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_IMPL_H_ |
6 #define MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_IMPL_H_ | 6 #define MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_IMPL_H_ |
7 | 7 |
| 8 #include <utility> |
8 #include <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/macros.h" | 11 #include "base/macros.h" |
11 #include "base/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.h" |
12 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
13 #include "mojo/application/public/cpp/app_lifetime_helper.h" | 14 #include "mojo/application/public/cpp/app_lifetime_helper.h" |
14 #include "mojo/application/public/cpp/application_connection.h" | 15 #include "mojo/application/public/cpp/application_connection.h" |
15 #include "mojo/application/public/cpp/application_delegate.h" | 16 #include "mojo/application/public/cpp/application_delegate.h" |
16 #include "mojo/application/public/cpp/lib/service_registry.h" | 17 #include "mojo/application/public/cpp/lib/service_registry.h" |
17 #include "mojo/application/public/interfaces/application.mojom.h" | 18 #include "mojo/application/public/interfaces/application.mojom.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // | 60 // |
60 // | 61 // |
61 class ApplicationImpl : public Application { | 62 class ApplicationImpl : public Application { |
62 public: | 63 public: |
63 class ConnectParams { | 64 class ConnectParams { |
64 public: | 65 public: |
65 explicit ConnectParams(const std::string& url); | 66 explicit ConnectParams(const std::string& url); |
66 explicit ConnectParams(URLRequestPtr request); | 67 explicit ConnectParams(URLRequestPtr request); |
67 ~ConnectParams(); | 68 ~ConnectParams(); |
68 | 69 |
69 URLRequestPtr TakeRequest() { return request_.Pass(); } | 70 URLRequestPtr TakeRequest() { return std::move(request_); } |
70 CapabilityFilterPtr TakeFilter() { return filter_.Pass(); } | 71 CapabilityFilterPtr TakeFilter() { return std::move(filter_); } |
71 void set_filter(CapabilityFilterPtr filter) { | 72 void set_filter(CapabilityFilterPtr filter) { filter_ = std::move(filter); } |
72 filter_ = filter.Pass(); | |
73 } | |
74 | 73 |
75 private: | 74 private: |
76 URLRequestPtr request_; | 75 URLRequestPtr request_; |
77 CapabilityFilterPtr filter_; | 76 CapabilityFilterPtr filter_; |
78 | 77 |
79 DISALLOW_COPY_AND_ASSIGN(ConnectParams); | 78 DISALLOW_COPY_AND_ASSIGN(ConnectParams); |
80 }; | 79 }; |
81 | 80 |
82 class TestApi { | 81 class TestApi { |
83 public: | 82 public: |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 AppLifetimeHelper app_lifetime_helper_; | 177 AppLifetimeHelper app_lifetime_helper_; |
179 bool quit_requested_; | 178 bool quit_requested_; |
180 base::WeakPtrFactory<ApplicationImpl> weak_factory_; | 179 base::WeakPtrFactory<ApplicationImpl> weak_factory_; |
181 | 180 |
182 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImpl); | 181 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImpl); |
183 }; | 182 }; |
184 | 183 |
185 } // namespace mojo | 184 } // namespace mojo |
186 | 185 |
187 #endif // MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_IMPL_H_ | 186 #endif // MOJO_APPLICATION_PUBLIC_CPP_APPLICATION_IMPL_H_ |
OLD | NEW |