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

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

Issue 10909182: Make FileSystemContext respect StoragePartitions. filesystem:// urls will be properly isolated (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove useless headers. 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
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 14 matching lines...) Expand all
25 #include "chrome/browser/profiles/profile_manager.h" 25 #include "chrome/browser/profiles/profile_manager.h"
26 #include "chrome/browser/ui/browser.h" 26 #include "chrome/browser/ui/browser.h"
27 #include "chrome/browser/ui/browser_finder.h" 27 #include "chrome/browser/ui/browser_finder.h"
28 #include "chrome/browser/ui/browser_tabstrip.h" 28 #include "chrome/browser/ui/browser_tabstrip.h"
29 #include "chrome/common/extensions/file_browser_handler.h" 29 #include "chrome/common/extensions/file_browser_handler.h"
30 #include "chrome/common/pref_names.h" 30 #include "chrome/common/pref_names.h"
31 #include "content/public/browser/browser_thread.h" 31 #include "content/public/browser/browser_thread.h"
32 #include "content/public/browser/child_process_security_policy.h" 32 #include "content/public/browser/child_process_security_policy.h"
33 #include "content/public/browser/render_process_host.h" 33 #include "content/public/browser/render_process_host.h"
34 #include "content/public/browser/site_instance.h" 34 #include "content/public/browser/site_instance.h"
35 #include "content/public/browser/storage_partition.h"
35 #include "content/public/browser/web_contents.h" 36 #include "content/public/browser/web_contents.h"
36 #include "net/base/escape.h" 37 #include "net/base/escape.h"
37 #include "webkit/chromeos/fileapi/cros_mount_point_provider.h" 38 #include "webkit/chromeos/fileapi/cros_mount_point_provider.h"
38 #include "webkit/fileapi/file_system_context.h" 39 #include "webkit/fileapi/file_system_context.h"
39 #include "webkit/fileapi/file_system_url.h" 40 #include "webkit/fileapi/file_system_url.h"
40 #include "webkit/fileapi/file_system_util.h" 41 #include "webkit/fileapi/file_system_util.h"
41 42
42 using content::BrowserContext; 43 using content::BrowserContext;
43 using content::BrowserThread; 44 using content::BrowserThread;
44 using content::ChildProcessSecurityPolicy; 45 using content::ChildProcessSecurityPolicy;
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after
745 return false; 746 return false;
746 747
747 int handler_pid = ExtractProcessFromExtensionId(handler->id(), profile()); 748 int handler_pid = ExtractProcessFromExtensionId(handler->id(), profile());
748 if (handler_pid <= 0) { 749 if (handler_pid <= 0) {
749 if (!handler->has_lazy_background_page()) 750 if (!handler->has_lazy_background_page())
750 return false; 751 return false;
751 } 752 }
752 753
753 done_ = done; 754 done_ = done;
754 755
755 // Get local file system instance on file thread.
756 scoped_refptr<fileapi::FileSystemContext> file_system_context = 756 scoped_refptr<fileapi::FileSystemContext> file_system_context =
757 BrowserContext::GetFileSystemContext(profile()); 757 BrowserContext::GetDefaultStoragePartition(profile())->
758 GetFileSystemContext();
759
758 BrowserThread::PostTask( 760 BrowserThread::PostTask(
759 BrowserThread::FILE, FROM_HERE, 761 BrowserThread::FILE, FROM_HERE,
760 base::Bind( 762 base::Bind(
761 &ExtensionTaskExecutor::RequestFileEntryOnFileThread, 763 &ExtensionTaskExecutor::RequestFileEntryOnFileThread,
762 this, 764 this,
763 file_system_context, 765 file_system_context,
764 Extension::GetBaseURLFromExtensionId(handler->id()), 766 Extension::GetBaseURLFromExtensionId(handler->id()),
765 handler, 767 handler,
766 handler_pid, 768 handler_pid,
767 file_urls)); 769 file_urls));
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 handler_pid, 962 handler_pid,
961 handler_host_permissions_[i].first, 963 handler_host_permissions_[i].first,
962 handler_host_permissions_[i].second); 964 handler_host_permissions_[i].second);
963 } 965 }
964 966
965 // We don't need this anymore. 967 // We don't need this anymore.
966 handler_host_permissions_.clear(); 968 handler_host_permissions_.clear();
967 } 969 }
968 970
969 } // namespace file_handler_util 971 } // namespace file_handler_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698