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

Unified Diff: extensions/renderer/file_system_natives.cc

Issue 1658913002: Make extensions use a correct same-origin check. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments. Created 4 years, 11 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: extensions/renderer/file_system_natives.cc
diff --git a/extensions/renderer/file_system_natives.cc b/extensions/renderer/file_system_natives.cc
index 12745096ce97ddc4e04a774c9444e306722bae27..2b7006299a22ccf092ead1089d4f07640474cabc 100644
--- a/extensions/renderer/file_system_natives.cc
+++ b/extensions/renderer/file_system_natives.cc
@@ -13,6 +13,7 @@
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/web/WebDOMFileSystem.h"
#include "third_party/WebKit/public/web/WebLocalFrame.h"
+#include "url/origin.h"
namespace extensions {
@@ -42,8 +43,8 @@ void FileSystemNatives::GetIsolatedFileSystem(
extensions::ScriptContext::GetDataSourceURLForFrame(webframe);
CHECK(context_url.SchemeIs(extensions::kExtensionScheme));
- std::string name(storage::GetIsolatedFileSystemName(context_url.GetOrigin(),
- file_system_id));
+ const GURL origin(url::Origin(context_url).Serialize());
+ std::string name(storage::GetIsolatedFileSystemName(origin, file_system_id));
// The optional second argument is the subfolder within the isolated file
// system at which to root the DOMFileSystem we're returning to the caller.
@@ -54,7 +55,7 @@ void FileSystemNatives::GetIsolatedFileSystem(
}
GURL root_url(storage::GetIsolatedFileSystemRootURIString(
- context_url.GetOrigin(), file_system_id, optional_root_name));
+ origin, file_system_id, optional_root_name));
args.GetReturnValue().Set(
blink::WebDOMFileSystem::create(webframe,

Powered by Google App Engine
This is Rietveld 408576698