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

Side by Side Diff: chrome/browser/media/router/media_route_provider_util_win.cc

Issue 1821823002: [Media Router] Conditionally enable mDNS on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Message loop to run loop 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/media/router/media_route_provider_util_win.h"
6
7 #include "base/files/file_path.h"
8 #include "base/location.h"
9 #include "base/path_service.h"
10 #include "chrome/installer/util/browser_distribution.h"
11 #include "chrome/installer/util/firewall_manager_win.h"
12 #include "content/public/browser/browser_thread.h"
13
14 namespace media_router {
15
16 namespace {
17
18 void DoCanFirewallUseLocalPorts(base::Callback<void(bool)> callback) {
imcheng 2016/03/25 06:26:30 const ref input
btolsch 2016/03/25 18:57:04 Done.
19 base::FilePath exe_path;
20 bool can_use_local_ports = false;
21 if (base::PathService::Get(base::FILE_EXE, &exe_path)) {
22 auto firewall_manager = installer::FirewallManager::Create(
23 BrowserDistribution::GetDistribution(), exe_path);
24 can_use_local_ports =
25 firewall_manager && firewall_manager->CanUseLocalPorts();
26 }
27 content::BrowserThread::PostTask(
28 content::BrowserThread::UI, FROM_HERE,
29 base::Bind(std::move(callback), can_use_local_ports));
imcheng 2016/03/25 06:26:30 is the std::move necessary?
btolsch 2016/03/25 18:57:04 A base::Callback is basically a pointer and a shar
30 }
31
32 } // namespace
33
34 void CanFirewallUseLocalPorts(base::Callback<void(bool)> callback) {
imcheng 2016/03/25 06:26:30 const ref input
btolsch 2016/03/25 18:57:04 Done.
35 content::BrowserThread::PostTask(
36 content::BrowserThread::FILE, FROM_HERE,
37 base::Bind(&DoCanFirewallUseLocalPorts, std::move(callback)));
imcheng 2016/03/25 06:26:30 is std::move necessary?
btolsch 2016/03/25 18:57:04 See other comment.
38 }
39
40 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698