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

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

Issue 612243002: Mojo: NULL -> nullptr in mojo/public/cpp outside of bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 #include "mojo/public/cpp/application/lib/weak_service_provider.h" 5 #include "mojo/public/cpp/application/lib/weak_service_provider.h"
6 6
7 #include "mojo/public/cpp/application/service_provider_impl.h" 7 #include "mojo/public/cpp/application/service_provider_impl.h"
8 #include "mojo/public/interfaces/application/service_provider.mojom.h" 8 #include "mojo/public/interfaces/application/service_provider.mojom.h"
9 9
10 namespace mojo { 10 namespace mojo {
11 namespace internal { 11 namespace internal {
12 12
13 WeakServiceProvider::WeakServiceProvider(ServiceProviderImpl* creator, 13 WeakServiceProvider::WeakServiceProvider(ServiceProviderImpl* creator,
14 ServiceProvider* service_provider) 14 ServiceProvider* service_provider)
15 : creator_(creator), 15 : creator_(creator),
16 service_provider_(service_provider) {} 16 service_provider_(service_provider) {}
17 17
18 WeakServiceProvider::~WeakServiceProvider() { 18 WeakServiceProvider::~WeakServiceProvider() {
19 if (creator_) 19 if (creator_)
20 creator_->ClearRemote(); 20 creator_->ClearRemote();
21 } 21 }
22 22
23 void WeakServiceProvider::Clear() { 23 void WeakServiceProvider::Clear() {
24 creator_ = NULL; 24 creator_ = nullptr;
25 service_provider_ = NULL; 25 service_provider_ = nullptr;
26 } 26 }
27 27
28 void WeakServiceProvider::ConnectToService( 28 void WeakServiceProvider::ConnectToService(
29 const String& service_name, 29 const String& service_name,
30 ScopedMessagePipeHandle client_handle) { 30 ScopedMessagePipeHandle client_handle) {
31 if (service_provider_) 31 if (service_provider_)
32 service_provider_->ConnectToService(service_name, client_handle.Pass()); 32 service_provider_->ConnectToService(service_name, client_handle.Pass());
33 } 33 }
34 34
35 } // namespace internal 35 } // namespace internal
36 } // namespace mojo 36 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/public/cpp/application/lib/service_registry.cc ('k') | mojo/public/cpp/environment/lib/environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698