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

Side by Side Diff: webkit/fileapi/sandbox_mount_point_provider.cc

Issue 7811006: Add full support for filesystem URLs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge errors Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « webkit/fileapi/file_system_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "webkit/fileapi/sandbox_mount_point_provider.h" 5 #include "webkit/fileapi/sandbox_mount_point_provider.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 return FilePath(); 647 return FilePath();
648 648
649 return root; 649 return root;
650 } 650 }
651 651
652 bool SandboxMountPointProvider::IsAllowedScheme(const GURL& url) const { 652 bool SandboxMountPointProvider::IsAllowedScheme(const GURL& url) const {
653 // Basically we only accept http or https. We allow file:// URLs 653 // Basically we only accept http or https. We allow file:// URLs
654 // only if --allow-file-access-from-files flag is given. 654 // only if --allow-file-access-from-files flag is given.
655 if (url.SchemeIs("http") || url.SchemeIs("https")) 655 if (url.SchemeIs("http") || url.SchemeIs("https"))
656 return true; 656 return true;
657 if (url.SchemeIsFileSystem())
658 return url.inner_url() && IsAllowedScheme(*url.inner_url());
659
657 for (size_t i = 0; 660 for (size_t i = 0;
658 i < file_system_options_.additional_allowed_schemes().size(); 661 i < file_system_options_.additional_allowed_schemes().size();
659 ++i) { 662 ++i) {
660 if (url.SchemeIs( 663 if (url.SchemeIs(
661 file_system_options_.additional_allowed_schemes()[i].c_str())) 664 file_system_options_.additional_allowed_schemes()[i].c_str()))
662 return true; 665 return true;
663 } 666 }
664 return false; 667 return false;
665 } 668 }
666 669
667 } // namespace fileapi 670 } // namespace fileapi
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698