Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 | 99 |
| 100 typedef std::vector<FileDefinition> FileDefinitionList; | 100 typedef std::vector<FileDefinition> FileDefinitionList; |
| 101 class ExecuteTasksFileSystemCallbackDispatcher; | 101 class ExecuteTasksFileSystemCallbackDispatcher; |
| 102 void RequestFileEntryOnFileThread( | 102 void RequestFileEntryOnFileThread( |
| 103 const GURL& handler_base_url, | 103 const GURL& handler_base_url, |
| 104 const scoped_refptr<const extensions::Extension>& handler, | 104 const scoped_refptr<const extensions::Extension>& handler, |
| 105 int handler_pid, | 105 int handler_pid, |
| 106 const std::vector<GURL>& file_urls); | 106 const std::vector<GURL>& file_urls); |
| 107 | 107 |
| 108 void ExecuteFailedOnUIThread(); | 108 void ExecuteFailedOnUIThread(); |
| 109 void ExecuteFileActionsOnUIThread(const std::string& file_system_name, | 109 void ExecuteFileActionsOnUIThread( |
| 110 const GURL& file_system_root, | 110 const FileDefinitionList& file_list, |
|
tbarzic
2012/06/08 17:59:13
this should probably be in the previoius line
hshi1
2012/06/08 18:21:41
Done.
| |
| 111 const FileDefinitionList& file_list, | 111 const base::Closure& callback); |
| 112 int handler_id); | |
| 113 void SetupPermissionsAndDispatchEvent(const std::string& file_system_name, | 112 void SetupPermissionsAndDispatchEvent(const std::string& file_system_name, |
| 114 const GURL& file_system_root, | 113 const GURL& file_system_root, |
| 115 const FileDefinitionList& file_list, | 114 const FileDefinitionList& file_list, |
| 116 int handler_pid_in, | 115 int handler_pid_in, |
| 117 ExtensionHost* host); | 116 ExtensionHost* host); |
| 118 | 117 |
| 119 // Populates |handler_host_permissions| with file path-permissions pairs that | 118 // Populates |handler_host_permissions| with file path-permissions pairs that |
| 120 // will be given to the handler extension host process. | 119 // will be given to the handler extension host process. |
| 121 void InitHandlerHostFileAccessPermissions( | 120 void InitHandlerHostFileAccessPermissions( |
| 122 const FileDefinitionList& file_list, | 121 const FileDefinitionList& file_list, |
| 123 const extensions::Extension* handler_extension, | 122 const extensions::Extension* handler_extension, |
| 124 const std::string& action_id); | 123 const std::string& action_id, |
| 124 const base::Closure& callback); | |
| 125 | |
| 126 // Invoked upon completion of InitHandlerHostFileAccessPermissions initiated | |
| 127 // by ExecuteFileActionsOnUIThread. | |
| 128 void OnInitAccessForExecuteFileActionsOnUIThread( | |
| 129 const std::string& file_system_name, | |
| 130 const GURL& file_system_root, | |
| 131 const FileDefinitionList& file_list, | |
| 132 int handler_pid); | |
| 133 | |
| 125 // Registers file permissions from |handler_host_permissions_| with | 134 // Registers file permissions from |handler_host_permissions_| with |
| 126 // ChildProcessSecurityPolicy for process with id |handler_pid|. | 135 // ChildProcessSecurityPolicy for process with id |handler_pid|. |
| 127 void SetupHandlerHostFileAccessPermissions(int handler_pid); | 136 void SetupHandlerHostFileAccessPermissions(int handler_pid); |
| 128 | 137 |
| 129 Profile* profile_; | 138 Profile* profile_; |
| 130 const GURL source_url_; | 139 const GURL source_url_; |
| 131 const std::string extension_id_; | 140 const std::string extension_id_; |
| 132 const std::string action_id_; | 141 const std::string action_id_; |
| 133 | 142 |
| 134 // (File path, permission for file path) pairs for the handler. | 143 // (File path, permission for file path) pairs for the handler. |
| 135 std::vector<std::pair<FilePath, int> > handler_host_permissions_; | 144 std::vector<std::pair<FilePath, int> > handler_host_permissions_; |
| 136 }; | 145 }; |
| 137 | 146 |
| 138 } // namespace file_handler_util | 147 } // namespace file_handler_util |
| 139 | 148 |
| 140 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ | 149 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_ |
| OLD | NEW |