OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/browser/cast_network_delegate.h" | 5 #include "chromecast/browser/cast_network_delegate.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "chromecast/base/chromecast_switches.h" | 9 #include "chromecast/base/chromecast_switches.h" |
10 | 10 |
11 namespace chromecast { | 11 namespace chromecast { |
12 namespace shell { | 12 namespace shell { |
13 | 13 |
14 CastNetworkDelegate::CastNetworkDelegate() { | 14 CastNetworkDelegate::CastNetworkDelegate() { |
15 DetachFromThread(); | 15 DETACH_FROM_THREAD(thread_checker_); |
16 } | 16 } |
17 | 17 |
18 CastNetworkDelegate::~CastNetworkDelegate() { | 18 CastNetworkDelegate::~CastNetworkDelegate() { |
19 } | 19 } |
20 | 20 |
21 bool CastNetworkDelegate::OnCanAccessFile( | 21 bool CastNetworkDelegate::OnCanAccessFile( |
22 const net::URLRequest& request, | 22 const net::URLRequest& request, |
23 const base::FilePath& original_path, | 23 const base::FilePath& original_path, |
24 const base::FilePath& absolute_path) const { | 24 const base::FilePath& absolute_path) const { |
25 if (base::CommandLine::ForCurrentProcess()-> | 25 if (base::CommandLine::ForCurrentProcess()-> |
26 HasSwitch(switches::kEnableLocalFileAccesses)) { | 26 HasSwitch(switches::kEnableLocalFileAccesses)) { |
27 return true; | 27 return true; |
28 } | 28 } |
29 | 29 |
30 LOG(WARNING) << "Could not access file " << original_path.value() | 30 LOG(WARNING) << "Could not access file " << original_path.value() |
31 << ". All file accesses are forbidden."; | 31 << ". All file accesses are forbidden."; |
32 return false; | 32 return false; |
33 } | 33 } |
34 | 34 |
35 } // namespace shell | 35 } // namespace shell |
36 } // namespace chromecast | 36 } // namespace chromecast |
OLD | NEW |