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

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

Issue 2382973002: Convert WebSecurityOrigin -> GURL without re-parsing the url (Closed)
Patch Set: rebase 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 449560595a986898487a46cbaf8d70dce5f894d9..8ff47a74694e53360040d2d0cdf434b68c778eb5 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)

Powered by Google App Engine
This is Rietveld 408576698