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

Side by Side Diff: chromecast/service/cast_network_delegate.cc

Issue 598303002: Chromecast: adds CastNetworkDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: uploads CastNetworkDelegate :) 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/service/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
13 CastNetworkDelegate::CastNetworkDelegate() {
14 DetachFromThread();
15 }
16
17 CastNetworkDelegate::~CastNetworkDelegate() {
18 }
19
20 bool CastNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
21 const base::FilePath& path) const {
22 #if defined(OS_ANDROID)
23 // On Chromecast, there's no reason to allow local file access.
24 if (base::CommandLine::ForCurrentProcess()->
25 HasSwitch(switches::kEnableLocalFileAccesses)) {
26 return true;
27 }
28 #endif // defined(OS_ANDROID)
29
30 LOG(WARNING) << "Could not access file " << path.value()
31 << ". All file accesses are forbidden.";
32 return false;
33 }
34
35 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698