Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/local_discovery/service_discovery_shared_client.h" | 5 #include "chrome/browser/local_discovery/service_discovery_shared_client.h" |
| 6 | 6 |
| 7 #include "content/public/browser/browser_thread.h" | 7 #include "content/public/browser/browser_thread.h" |
| 8 | 8 |
| 9 #if defined(OS_MACOSX) | 9 #if defined(OS_MACOSX) |
| 10 #include "chrome/browser/local_discovery/service_discovery_client_mac.h" | 10 #include "chrome/browser/local_discovery/service_discovery_client_mac.h" |
| 11 #endif | 11 #endif |
| 12 | 12 |
| 13 #if defined(ENABLE_MDNS) | 13 #if defined(ENABLE_MDNS) |
| 14 #include "chrome/browser/local_discovery/service_discovery_client_mdns.h" | |
| 14 #include "chrome/browser/local_discovery/service_discovery_client_utility.h" | 15 #include "chrome/browser/local_discovery/service_discovery_client_utility.h" |
| 15 #endif // ENABLE_MDNS | 16 #endif // ENABLE_MDNS |
| 16 | 17 |
| 17 namespace local_discovery { | 18 namespace local_discovery { |
| 18 | 19 |
| 19 using content::BrowserThread; | 20 using content::BrowserThread; |
| 20 | 21 |
| 21 namespace { | 22 namespace { |
| 22 ServiceDiscoverySharedClient* g_service_discovery_client = NULL; | 23 ServiceDiscoverySharedClient* g_service_discovery_client = NULL; |
| 23 } // namespace | 24 } // namespace |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 37 scoped_refptr<ServiceDiscoverySharedClient> | 38 scoped_refptr<ServiceDiscoverySharedClient> |
| 38 ServiceDiscoverySharedClient::GetInstance() { | 39 ServiceDiscoverySharedClient::GetInstance() { |
| 39 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 40 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 40 | 41 |
| 41 if (g_service_discovery_client) | 42 if (g_service_discovery_client) |
| 42 return g_service_discovery_client; | 43 return g_service_discovery_client; |
| 43 | 44 |
| 44 #if defined(OS_MACOSX) | 45 #if defined(OS_MACOSX) |
| 45 return new ServiceDiscoveryClientMac(); | 46 return new ServiceDiscoveryClientMac(); |
| 46 #else | 47 #else |
| 47 return new ServiceDiscoveryClientUtility(); | 48 return new ServiceDiscoveryClientMdns(); |
|
Vitaly Buka (NO REVIEWS)
2014/04/28 23:01:49
Ugh, I didn't expect to enable this here.
| |
| 48 #endif | 49 #endif |
| 49 } | 50 } |
| 50 | 51 |
| 51 #else | 52 #else |
| 52 | 53 |
| 53 scoped_refptr<ServiceDiscoverySharedClient> | 54 scoped_refptr<ServiceDiscoverySharedClient> |
| 54 ServiceDiscoverySharedClient::GetInstance() { | 55 ServiceDiscoverySharedClient::GetInstance() { |
| 55 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 56 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 56 NOTIMPLEMENTED(); | 57 NOTIMPLEMENTED(); |
| 57 return NULL; | 58 return NULL; |
| 58 } | 59 } |
| 59 | 60 |
| 60 #endif // ENABLE_MDNS | 61 #endif // ENABLE_MDNS |
| 61 | 62 |
| 62 } // namespace local_discovery | 63 } // namespace local_discovery |
| OLD | NEW |