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

Side by Side Diff: chromecast/shell/browser/cast_network_delegate.cc

Issue 598303002: Chromecast: adds CastNetworkDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removes gyp dep Created 6 years, 2 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 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.
4
5 #include "chromecast/shell/browser/cast_network_delegate.h"
6
7 #include "base/command_line.h"
8 #include "base/files/file_path.h"
9 #include "chromecast/common/chromecast_switches.h"
10
11 namespace chromecast {
12 namespace shell {
13
14 CastNetworkDelegate::CastNetworkDelegate() {
15 DetachFromThread();
16 }
17
18 CastNetworkDelegate::~CastNetworkDelegate() {
19 }
20
21 bool CastNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
22 const base::FilePath& path) const {
23 #if defined(OS_ANDROID)
24 // On Chromecast, there's no reason to allow local file access.
25 if (base::CommandLine::ForCurrentProcess()->
26 HasSwitch(switches::kEnableLocalFileAccesses)) {
27 return true;
28 }
29 #endif // defined(OS_ANDROID)
30
31 LOG(WARNING) << "Could not access file " << path.value()
32 << ". All file accesses are forbidden.";
33 return false;
34 }
35
36 } // namespace shell
37 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/shell/browser/cast_network_delegate.h ('k') | chromecast/shell/browser/cast_network_delegate_simple.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698