OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "mojo/public/cpp/application/lib/weak_service_provider.h" |
| 6 #include "mojo/public/interfaces/application/service_provider.mojom.h" |
| 7 |
| 8 namespace mojo { |
| 9 namespace internal { |
| 10 |
| 11 WeakServiceProvider::WeakServiceProvider(ServiceProvider* service_provider) |
| 12 : service_provider_(service_provider) {} |
| 13 |
| 14 WeakServiceProvider::~WeakServiceProvider() {} |
| 15 |
| 16 void WeakServiceProvider::Clear() { |
| 17 service_provider_ = NULL; |
| 18 } |
| 19 |
| 20 void WeakServiceProvider::ConnectToService( |
| 21 const String& service_name, |
| 22 ScopedMessagePipeHandle client_handle) { |
| 23 if (service_provider_) |
| 24 service_provider_->ConnectToService(service_name, client_handle.Pass()); |
| 25 } |
| 26 |
| 27 } // namespace internal |
| 28 } // namespace mojo |
OLD | NEW |