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

Side by Side Diff: chrome/browser/chromeos/extensions/file_handler_util.cc

Issue 10873055: Changed FileSystemPointProvider::IsAcccessAllowed() to take a single FileSystemURL instead of a tri… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix for typos from Kinuko's review. Sorry, I will look more closely at my own diff next time Created 8 years, 3 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 | « no previous file | webkit/chromeos/fileapi/cros_mount_point_provider.h » ('j') | 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 "chrome/browser/chromeos/extensions/file_handler_util.h" 5 #include "chrome/browser/chromeos/extensions/file_handler_util.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 569
570 fileapi::FileSystemURL url(origin_file_url); 570 fileapi::FileSystemURL url(origin_file_url);
571 if (!chromeos::CrosMountPointProvider::CanHandleURL(url)) 571 if (!chromeos::CrosMountPointProvider::CanHandleURL(url))
572 return false; 572 return false;
573 573
574 fileapi::ExternalFileSystemMountPointProvider* external_provider = 574 fileapi::ExternalFileSystemMountPointProvider* external_provider =
575 file_system_context_->external_provider(); 575 file_system_context_->external_provider();
576 if (!external_provider) 576 if (!external_provider)
577 return false; 577 return false;
578 578
579 if (!external_provider->IsAccessAllowed(url.origin(), 579 if (!external_provider->IsAccessAllowed(url))
hashimoto 2012/08/27 06:43:22 nit: Combine this 'if' with the above one using '|
580 url.type(),
581 url.virtual_path())) {
582 return false; 580 return false;
583 }
584 581
585 // Make sure this url really being used by the right caller extension. 582 // Make sure this url really being used by the right caller extension.
586 if (source_url_.GetOrigin() != url.origin()) { 583 if (source_url_.GetOrigin() != url.origin()) {
587 DidFail(base::PLATFORM_FILE_ERROR_SECURITY); 584 DidFail(base::PLATFORM_FILE_ERROR_SECURITY);
588 return false; 585 return false;
589 } 586 }
590 587
591 // Check if this file system entry exists first. 588 // Check if this file system entry exists first.
592 base::PlatformFileInfo file_info; 589 base::PlatformFileInfo file_info;
593 590
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 handler_pid, 875 handler_pid,
879 handler_host_permissions_[i].first, 876 handler_host_permissions_[i].first,
880 handler_host_permissions_[i].second); 877 handler_host_permissions_[i].second);
881 } 878 }
882 879
883 // We don't need this anymore. 880 // We don't need this anymore.
884 handler_host_permissions_.clear(); 881 handler_host_permissions_.clear();
885 } 882 }
886 883
887 } // namespace file_handler_util 884 } // namespace file_handler_util
OLDNEW
« no previous file with comments | « no previous file | webkit/chromeos/fileapi/cros_mount_point_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698