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

Unified Diff: chrome/browser/media/router/media_router_mojo_impl.h

Issue 1821823002: [Media Router] Conditionally enable mDNS on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments, build, and removing move Created 4 years, 9 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
Index: chrome/browser/media/router/media_router_mojo_impl.h
diff --git a/chrome/browser/media/router/media_router_mojo_impl.h b/chrome/browser/media/router/media_router_mojo_impl.h
index 35ca51e2c872408614870b106f10dcdf9677ca10..72c3168dbd5ec4131c73a73ee3c31587d3a98fd4 100644
--- a/chrome/browser/media/router/media_router_mojo_impl.h
+++ b/chrome/browser/media/router/media_router_mojo_impl.h
@@ -21,6 +21,7 @@
#include "base/memory/weak_ptr.h"
#include "base/observer_list.h"
#include "base/thread_task_runner_handle.h"
+#include "build/build_config.h"
#include "chrome/browser/media/router/issue.h"
#include "chrome/browser/media/router/issue_manager.h"
#include "chrome/browser/media/router/media_router.mojom.h"
@@ -98,6 +99,8 @@ class MediaRouterMojoImpl : public MediaRouterBase,
const SendRouteMessageCallback& callback) override;
void AddIssue(const Issue& issue) override;
void ClearIssue(const Issue::Id& issue_id) override;
+ bool should_enable_mdns_discovery() const override;
+ void EnsureMdnsDiscoveryEnabled() override;
const std::string& media_route_provider_extension_id() const {
return media_route_provider_extension_id_;
@@ -251,6 +254,7 @@ class MediaRouterMojoImpl : public MediaRouterBase,
void DoStopObservingMediaSinks(const MediaSource::Id& source_id);
void DoStartObservingMediaRoutes(const MediaSource::Id& source_id);
void DoStopObservingMediaRoutes(const MediaSource::Id& source_id);
+ void DoEnsureMdnsDiscoveryEnabled();
// Invoked when the next batch of messages arrives.
// |route_id|: ID of route of the messages.
@@ -320,6 +324,8 @@ class MediaRouterMojoImpl : public MediaRouterBase,
// Clears the wake reason after the extension has been awoken.
void ClearWakeReason();
+ void EnableMdnsFromFirewallCheck(bool firewall_can_use_local_ports);
+
// Pending requests queued to be executed once component extension
// becomes ready.
std::deque<base::Closure> pending_requests_;
@@ -381,6 +387,16 @@ class MediaRouterMojoImpl : public MediaRouterBase,
// initial event page wakeup attempt.
bool provider_version_was_recorded_ = false;
+ // A flag to ensure that mDNS discovery is only enabled on Windows when there
+ // will be appropriate context for the user to associate a firewall prompt
+ // with Media Router. This can be set to |true| earlier if we know that a
+ // prompt will not occur.
+#if defined(OS_WIN)
+ bool should_enable_mdns_discovery_ = false;
+#else
+ bool should_enable_mdns_discovery_ = true;
+#endif
+
base::WeakPtrFactory<MediaRouterMojoImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl);

Powered by Google App Engine
This is Rietveld 408576698