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

Side by Side Diff: mojo/public/cpp/application/lib/weak_service_provider.cc

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 unified diff | Download patch
OLDNEW
(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
7 #include "mojo/public/cpp/application/service_provider_impl.h"
8 #include "mojo/public/interfaces/application/service_provider.mojom.h"
9
10 namespace mojo {
11 namespace internal {
12
13 WeakServiceProvider::WeakServiceProvider(ServiceProviderImpl* creator,
14 ServiceProvider* service_provider)
15 : creator_(creator), service_provider_(service_provider) {
16 }
17
18 WeakServiceProvider::~WeakServiceProvider() {
19 if (creator_)
20 creator_->ClearRemote();
21 }
22
23 void WeakServiceProvider::Clear() {
24 creator_ = nullptr;
25 service_provider_ = nullptr;
26 }
27
28 void WeakServiceProvider::ConnectToService(
29 const String& service_name,
30 ScopedMessagePipeHandle client_handle) {
31 if (service_provider_)
32 service_provider_->ConnectToService(service_name, client_handle.Pass());
33 }
34
35 } // namespace internal
36 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/application/lib/weak_service_provider.h ('k') | mojo/public/cpp/application/service_provider_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698