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

Unified Diff: chrome/browser/local_discovery/service_discovery_shared_client.cc

Issue 287923002: Enable ServiceDiscoveryClientMdns. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/local_discovery/service_discovery_shared_client.cc
diff --git a/chrome/browser/local_discovery/service_discovery_shared_client.cc b/chrome/browser/local_discovery/service_discovery_shared_client.cc
index 01c3c00d152e67255ddf13a53822a47f34c24124..e7f851e50c0b38f229991c7904e752b64c3a9e1d 100644
--- a/chrome/browser/local_discovery/service_discovery_shared_client.cc
+++ b/chrome/browser/local_discovery/service_discovery_shared_client.cc
@@ -20,12 +20,16 @@
#endif
#if defined(ENABLE_MDNS)
+#include "chrome/browser/local_discovery/service_discovery_client_mdns.h"
#include "chrome/browser/local_discovery/service_discovery_client_utility.h"
#endif // ENABLE_MDNS
namespace {
#if defined(OS_WIN)
+
+bool g_is_firewall_ready = false;
+
void ReportFirewallStats() {
base::FilePath exe_path;
if (!PathService::Get(base::FILE_EXE, &exe_path))
@@ -36,9 +40,9 @@ void ReportFirewallStats() {
exe_path);
if (!manager)
return;
- bool is_ready = manager->CanUseLocalPorts();
+ g_is_firewall_ready = manager->CanUseLocalPorts();
UMA_HISTOGRAM_TIMES("LocalDiscovery.FirewallAccessTime", timer.Elapsed());
- UMA_HISTOGRAM_BOOLEAN("LocalDiscovery.IsFirewallReady", is_ready);
+ UMA_HISTOGRAM_BOOLEAN("LocalDiscovery.IsFirewallReady", g_is_firewall_ready);
}
#endif // OS_WIN
@@ -80,11 +84,13 @@ scoped_refptr<ServiceDiscoverySharedClient>
static bool reported =
BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
base::Bind(&ReportFirewallStats));
-#endif // OS_WIN
-
// TODO(vitalybuka): Switch to |ServiceDiscoveryClientMdns| after we find what
// to do with firewall for user-level installs. crbug.com/366408
- return new ServiceDiscoveryClientUtility();
+ if (!g_is_firewall_ready)
+ return new ServiceDiscoveryClientUtility();
Noam Samuel 2014/05/14 18:35:09 Does this mean that ServiceDiscoveryClientUtility
Vitaly Buka (NO REVIEWS) 2014/05/14 19:11:41 No. Only one is alive in time. Check g_service_dis
Noam Samuel 2014/05/14 19:54:45 Wait, so does this mean that Chrome on Windows wil
+#endif // OS_WIN
+
+ return new ServiceDiscoveryClientMdns();
#endif // OS_MACOSX
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698