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

Side by Side Diff: mojo/shell/network_delegate.cc

Issue 38303002: Enable Mojo to download from file URLs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « mojo/shell/network_delegate.h ('k') | mojo/shell/url_request_context_getter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 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 "mojo/shell/network_delegate.h"
6
7 #include "base/command_line.h"
8 #include "mojo/shell/switches.h"
9 #include "net/url_request/url_request.h"
10
11 namespace mojo {
12 namespace shell {
13
14 NetworkDelegate::NetworkDelegate() {
15 DetachFromThread();
16 }
17
18 bool NetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
19 const base::FilePath& path) const {
20 // TODO(aa): We might want to add a --allow-file-urls or something, but
21 // starting conservative.
22 return CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kApp)
23 == request.url().spec();
24 }
25
26 } // namespace shell
27 } // namespace mojo
OLDNEW
« no previous file with comments | « mojo/shell/network_delegate.h ('k') | mojo/shell/url_request_context_getter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698