summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-12 22:54:42 +0000
committerericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-12 22:54:42 +0000
commit3e0c664682b788f3093e0528a772b51c72e95a1f (patch)
tree9164fad6eb703b815c7d32374a074ba9ea955a06 /chrome
parentcda3f562a282c8adab5adbb16a90ad9532b8d021 (diff)
downloadchromium_src-3e0c664682b788f3093e0528a772b51c72e95a1f.zip
chromium_src-3e0c664682b788f3093e0528a772b51c72e95a1f.tar.gz
chromium_src-3e0c664682b788f3093e0528a772b51c72e95a1f.tar.bz2
More filesystem cleanup: convert URL-encoded-as-FilePath to actual URL, where
possible without WebKit API changes. The WebKit changes will happen in another CL. This is a resubmit of http://codereview.chromium.org/6767010/ [third try lucky, fourth try persistent?], which bounced most recently due to bugs manifesting only on XP. There are a few changes here that weren't there [in file_system_operation_write_unittest.cc and file_system_operation.cc], but they're pretty trivial build/test fixes. BUG=none TEST=none Review URL: http://codereview.chromium.org/6821065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81319 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/extensions/extension_file_browser_private_api.cc9
-rw-r--r--chrome/browser/extensions/extension_file_browser_private_api.h6
2 files changed, 9 insertions, 6 deletions
diff --git a/chrome/browser/extensions/extension_file_browser_private_api.cc b/chrome/browser/extensions/extension_file_browser_private_api.cc
index e578e12..0f5093d 100644
--- a/chrome/browser/extensions/extension_file_browser_private_api.cc
+++ b/chrome/browser/extensions/extension_file_browser_private_api.cc
@@ -12,6 +12,7 @@
#include "chrome/common/extensions/extension.h"
#include "content/browser/browser_thread.h"
#include "content/browser/tab_contents/tab_contents.h"
+#include "googleurl/src/gurl.h"
#include "grit/generated_resources.h"
#include "webkit/fileapi/file_system_context.h"
#include "webkit/fileapi/file_system_operation.h"
@@ -44,13 +45,13 @@ class LocalFileSystemCallbackDispatcher
NOTREACHED();
}
virtual void DidOpenFileSystem(const std::string& name,
- const FilePath& path) OVERRIDE {
+ const GURL& root) OVERRIDE {
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
NewRunnableMethod(function_,
&RequestLocalFileSystemFunction::RespondSuccessOnUIThread,
name,
- path));
+ root));
}
virtual void DidFail(base::PlatformFileError error_code) OVERRIDE {
BrowserThread::PostTask(
@@ -85,12 +86,12 @@ bool RequestLocalFileSystemFunction::RunImpl() {
}
void RequestLocalFileSystemFunction::RespondSuccessOnUIThread(
- const std::string& name, const FilePath& path) {
+ const std::string& name, const GURL& root) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
result_.reset(new DictionaryValue());
DictionaryValue* dict = reinterpret_cast<DictionaryValue*>(result_.get());
dict->SetString("name", name);
- dict->SetString("path", path.value());
+ dict->SetString("path", root.spec());
dict->SetInteger("error", base::PLATFORM_FILE_OK);
SendResponse(true);
}
diff --git a/chrome/browser/extensions/extension_file_browser_private_api.h b/chrome/browser/extensions/extension_file_browser_private_api.h
index a56a484..45391cf 100644
--- a/chrome/browser/extensions/extension_file_browser_private_api.h
+++ b/chrome/browser/extensions/extension_file_browser_private_api.h
@@ -10,11 +10,13 @@
#include <string>
#include <vector>
-#include "base/file_path.h"
+#include "base/platform_file.h"
#include "chrome/browser/extensions/extension_function.h"
#include "chrome/browser/ui/shell_dialogs.h"
#include "webkit/fileapi/file_system_callback_dispatcher.h"
+class GURL;
+
// Implements the Chrome Extension local File API.
class RequestLocalFileSystemFunction
: public AsyncExtensionFunction {
@@ -30,7 +32,7 @@ class RequestLocalFileSystemFunction
private:
friend class LocalFileSystemCallbackDispatcher;
void RespondSuccessOnUIThread(const std::string& name,
- const FilePath& path);
+ const GURL& root);
void RespondFailedOnUIThread(base::PlatformFileError error_code);
DECLARE_EXTENSION_FUNCTION_NAME("fileBrowserPrivate.requestLocalFileSystem");