Chromium Code Reviews| Index: chrome/browser/local_discovery/service_discovery_client.cc |
| diff --git a/chrome/browser/local_discovery/service_discovery_client.cc b/chrome/browser/local_discovery/service_discovery_client.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4a0ace474b32826c961cf4f62d20b0ceb4b47fb0 |
| --- /dev/null |
| +++ b/chrome/browser/local_discovery/service_discovery_client.cc |
| @@ -0,0 +1,23 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/local_discovery/service_discovery_client.h" |
| +#include "chrome/browser/local_discovery/service_discovery_client_impl.h" |
| + |
| +namespace local_discovery { |
| +static ServiceDiscoveryClient* g_instance = NULL; |
| + |
| +ServiceDiscoveryClient* ServiceDiscoveryClient::GetInstance() { |
| + if (!g_instance) { |
| + g_instance = new ServiceDiscoveryClientImpl(); |
|
Vitaly Buka (NO REVIEWS)
2013/06/15 00:22:30
maybe
return g_instance ? g_instance : Singleton<S
|
| + } |
| + |
| + return g_instance; |
| +} |
| + |
| +void ServiceDiscoveryClient::SetInstance(ServiceDiscoveryClient* instance) { |
| + g_instance = instance; |
| +} |
| + |
| +} // namespace local_discovery |