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

Unified Diff: chrome/browser/chromeos/extensions/file_handler_util.h

Issue 10067021: Postpone setting up file handler's file permissions if handler is running lazy background page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/extensions/file_handler_util.h
diff --git a/chrome/browser/chromeos/extensions/file_handler_util.h b/chrome/browser/chromeos/extensions/file_handler_util.h
index 899f36bf98017f3101804cd624e4977638209141..cab121f15f92dce1045ca62e91214f301425b015 100644
--- a/chrome/browser/chromeos/extensions/file_handler_util.h
+++ b/chrome/browser/chromeos/extensions/file_handler_util.h
@@ -6,11 +6,14 @@
#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_HANDLER_UTIL_H_
#pragma once
+#include <vector>
+
#include "base/platform_file.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/url_pattern_set.h"
class Browser;
+class ExtensionHost;
class FileBrowserHandler;
class GURL;
class Profile;
@@ -89,6 +92,7 @@ class FileTaskExecutor : public base::RefCountedThreadSafe<FileTaskExecutor> {
FilePath absolute_path;
bool is_directory;
};
+
typedef std::vector<FileDefinition> FileDefinitionList;
class ExecuteTasksFileSystemCallbackDispatcher;
void RequestFileEntryOnFileThread(
@@ -96,20 +100,35 @@ class FileTaskExecutor : public base::RefCountedThreadSafe<FileTaskExecutor> {
const scoped_refptr<const Extension>& handler,
int handler_pid,
const std::vector<GURL>& file_urls);
- void SetupFileAccessPermissionsForGDataCache(
- const FileDefinitionList& file_list,
- int handler_pid);
- void RespondFailedOnUIThread(base::PlatformFileError error_code);
+
+ void ExecuteFailedOnUIThread();
void ExecuteFileActionsOnUIThread(const std::string& file_system_name,
const GURL& file_system_root,
const FileDefinitionList& file_list,
int handler_id);
- void ExecuteFailedOnUIThread();
+ void SetupPermissionsAndDispatchEvent(const std::string& file_system_name,
+ const GURL& file_system_root,
+ const FileDefinitionList& file_list,
+ int handler_pid_in,
+ ExtensionHost* host);
+
+ // Populates |handler_host_permissions| with file path-permissions pairs that
+ // will be given to the handler extension host process.
+ void InitHandlerHostFileAccessPermissions(
+ const FileDefinitionList& file_list,
+ const Extension* handler_extension,
+ const std::string& action_id);
+ // Registers file permissions from |handler_host_permissions_| with
+ // ChildProcessSecurityPolicy for process with id |handler_pid|.
+ void SetupHandlerHostFileAccessPermissions(int handler_pid);
Profile* profile_;
const GURL source_url_;
const std::string extension_id_;
const std::string action_id_;
+
+ // (File path, permission for file path) pairs for the handler.
+ std::vector<std::pair<FilePath, int> > handler_host_permissions_;
};
} // namespace file_handler_util

Powered by Google App Engine
This is Rietveld 408576698