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

Unified Diff: chrome/renderer/extensions/resource_request_policy.cc

Issue 2382973002: Convert WebSecurityOrigin -> GURL without re-parsing the url (Closed)
Patch Set: rebase on #427122 Created 4 years, 2 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/renderer/extensions/resource_request_policy.cc
diff --git a/chrome/renderer/extensions/resource_request_policy.cc b/chrome/renderer/extensions/resource_request_policy.cc
index 5812f8a8c0e531e81f9a964bf3e9f8805894cdd4..26250fd733c4db30de6ff74b2e3165f2f8138c66 100644
--- a/chrome/renderer/extensions/resource_request_policy.cc
+++ b/chrome/renderer/extensions/resource_request_policy.cc
@@ -23,6 +23,7 @@
#include "third_party/WebKit/public/web/WebFrame.h"
#include "ui/base/page_transition_types.h"
#include "url/gurl.h"
+#include "url/origin.h"
namespace extensions {
@@ -75,8 +76,7 @@ bool ResourceRequestPolicy::CanRequestResource(
// The page_origin may be GURL("null") for unique origins like data URLs,
// but this is ok for the checks below. We only care if it matches the
// current extension or has a devtools scheme.
- GURL page_origin =
- blink::WebStringToGURL(frame->top()->getSecurityOrigin().toString());
+ GURL page_origin = url::Origin(frame->top()->getSecurityOrigin()).GetURL();
// Exceptions are:
// - empty origin (needed for some edge cases when we have empty origins)
« no previous file with comments | « chrome/renderer/extensions/media_galleries_custom_bindings.cc ('k') | chrome/renderer/plugins/chrome_plugin_placeholder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698