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

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: Merged out Created 8 years, 9 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
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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 return FilePath(); 644 return FilePath();
645 645
646 return root; 646 return root;
647 } 647 }
648 648
649 bool SandboxMountPointProvider::IsAllowedScheme(const GURL& url) const { 649 bool SandboxMountPointProvider::IsAllowedScheme(const GURL& url) const {
650 // Basically we only accept http or https. We allow file:// URLs 650 // Basically we only accept http or https. We allow file:// URLs
651 // only if --allow-file-access-from-files flag is given. 651 // only if --allow-file-access-from-files flag is given.
652 if (url.SchemeIs("http") || url.SchemeIs("https")) 652 if (url.SchemeIs("http") || url.SchemeIs("https"))
653 return true; 653 return true;
654 if (url.SchemeIsFileSystem())
655 return url.inner_url() && IsAllowedScheme(*url.inner_url());
656
654 for (size_t i = 0; 657 for (size_t i = 0;
655 i < file_system_options_.additional_allowed_schemes().size(); 658 i < file_system_options_.additional_allowed_schemes().size();
656 ++i) { 659 ++i) {
657 if (url.SchemeIs( 660 if (url.SchemeIs(
658 file_system_options_.additional_allowed_schemes()[i].c_str())) 661 file_system_options_.additional_allowed_schemes()[i].c_str()))
659 return true; 662 return true;
660 } 663 }
661 return false; 664 return false;
662 } 665 }
663 666
664 } // namespace fileapi 667 } // namespace fileapi
OLDNEW
« chrome/common/extensions/url_pattern.cc ('K') | « webkit/fileapi/file_system_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698