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

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: Don't break the tests — we shouldn't have been adding null origins anyway. 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..dad0d30b8a727933c3461f07df8b8477530d625f 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 = GURL(url::Origin(context_url).Serialize());
brettw 2016/02/03 19:12:38 This would be better as: const GURL origin(url::
palmer 2016/02/03 20:47:58 Done.
+ 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