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_factory.h" | 10 #include "chrome/browser/local_discovery/service_discovery_client_mac_factory.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 #endif // ENABLE_MDNS | 15 #endif // ENABLE_MDNS |
16 | 16 |
17 namespace local_discovery { | 17 namespace local_discovery { |
18 | 18 |
19 using content::BrowserThread; | 19 using content::BrowserThread; |
20 | 20 |
21 namespace { | 21 namespace { |
22 ServiceDiscoverySharedClient* g_service_discovery_client = NULL; | 22 ServiceDiscoverySharedClient* g_service_discovery_client = NULL; |
23 } // namespace | 23 } // namespace |
24 | 24 |
(...skipping 12 matching lines...) Expand all Loading... |
37 scoped_refptr<ServiceDiscoverySharedClient> | 37 scoped_refptr<ServiceDiscoverySharedClient> |
38 ServiceDiscoverySharedClient::GetInstance() { | 38 ServiceDiscoverySharedClient::GetInstance() { |
39 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 39 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
40 | 40 |
41 if (g_service_discovery_client) | 41 if (g_service_discovery_client) |
42 return g_service_discovery_client; | 42 return g_service_discovery_client; |
43 | 43 |
44 #if defined(OS_MACOSX) | 44 #if defined(OS_MACOSX) |
45 return ServiceDiscoveryClientMacFactory::CreateInstance(); | 45 return ServiceDiscoveryClientMacFactory::CreateInstance(); |
46 #else | 46 #else |
47 return new ServiceDiscoveryClientMdns(); | 47 return new ServiceDiscoveryClientUtility(); |
48 #endif | 48 #endif |
49 } | 49 } |
50 | 50 |
51 #else | 51 #else |
52 | 52 |
53 scoped_refptr<ServiceDiscoverySharedClient> | 53 scoped_refptr<ServiceDiscoverySharedClient> |
54 ServiceDiscoverySharedClient::GetInstance() { | 54 ServiceDiscoverySharedClient::GetInstance() { |
55 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 55 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
56 NOTIMPLEMENTED(); | 56 NOTIMPLEMENTED(); |
57 return NULL; | 57 return NULL; |
58 } | 58 } |
59 | 59 |
60 #endif // ENABLE_MDNS | 60 #endif // ENABLE_MDNS |
61 | 61 |
62 } // namespace local_discovery | 62 } // namespace local_discovery |
OLD | NEW |