Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chromecast / browser / cast_network_delegate.cc
blob3e004a0a53934403e3944e9070613a925c058a86
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
3 // found in the LICENSE file.
5 #include "chromecast/browser/cast_network_delegate.h"
7 #include "base/command_line.h"
8 #include "base/files/file_path.h"
9 #include "chromecast/base/chromecast_switches.h"
11 namespace chromecast {
12 namespace shell {
14 CastNetworkDelegate::CastNetworkDelegate() {
15 DetachFromThread();
18 CastNetworkDelegate::~CastNetworkDelegate() {
21 bool CastNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
22 const base::FilePath& path) const {
23 if (base::CommandLine::ForCurrentProcess()->
24 HasSwitch(switches::kEnableLocalFileAccesses)) {
25 return true;
28 LOG(WARNING) << "Could not access file " << path.value()
29 << ". All file accesses are forbidden.";
30 return false;
33 } // namespace shell
34 } // namespace chromecast