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

Unified Diff: chrome/renderer/content_settings_observer.cc

Issue 2354083002: Avoid crash in ContentSettingsObserver::GetOriginOrURL with top remote frames. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/content_settings_observer.cc
diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc
index 8bd0430b15b7f9d5a016f7fbce3a8d4e4dc0da13..663288d26c8abdceb7043dc12f43b519d4c64e2d 100644
--- a/chrome/renderer/content_settings_observer.cc
+++ b/chrome/renderer/content_settings_observer.cc
@@ -49,8 +49,8 @@ GURL GetOriginOrURL(const WebFrame* frame) {
// document URL as the primary URL in those cases.
// TODO(alexmos): This is broken for --site-per-process, since top() can be a
// WebRemoteFrame which does not have a document(), and the WebRemoteFrame's
- // URL is not replicated.
- if (top_origin == "null")
+ // URL is not replicated. See https://crbug.com/628759.
+ if (top_origin == "null" && frame->top()->isWebLocalFrame())
return frame->top()->document().url();
return blink::WebStringToGURL(top_origin);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698