Index: content/browser/frame_host/frame_tree_node.cc |
diff --git a/content/browser/frame_host/frame_tree_node.cc b/content/browser/frame_host/frame_tree_node.cc |
index 41be622302eda45b16c991faf562b1abf7f55917..ab0e2af07d5e512259b7ae52e66505caff23775d 100644 |
--- a/content/browser/frame_host/frame_tree_node.cc |
+++ b/content/browser/frame_host/frame_tree_node.cc |
@@ -96,4 +96,23 @@ void FrameTreeNode::ResetForNewProcess() { |
old_children.clear(); // May notify observers. |
} |
+void FrameTreeNode::SetOriginFromURL(const GURL& url) { |
Charlie Reis
2014/11/13 18:00:57
This is more SetReplicationState, right?
|
+ // This mimicks blink::SecurityOrigin::create for detecting schemes that |
+ // should result in unique origins. |
+ // TODO(alexmos): blink::SecurityOrigin::create does other things that we may |
+ // want to do here eventually (e.g., handling innerURLs for blob: and |
+ // filesystem:). |
+ if (!url.is_valid() || |
+ url.SchemeIs(url::kAboutScheme) || |
dcheng
2014/11/12 22:16:43
Hm... this doesn't seem quite correct. about:blank
alexmos
2014/11/18 18:25:32
This and the other more complex cases are now fixe
|
+ url.SchemeIs(url::kDataScheme) || |
+ url.SchemeIs(url::kJavaScriptScheme)) { |
+ replication_state_.is_unique_origin = true; |
+ replication_state_.origin = url::Origin(); |
Charlie Reis
2014/11/13 18:00:57
Hmm, I'm wondering if there's a better place for t
alexmos
2014/11/18 18:25:32
See my answer for Daniel's question above.
|
+ return; |
+ } |
+ DCHECK(url.GetOrigin().is_valid()); |
+ replication_state_.origin = url::Origin(url.GetOrigin().spec()); |
+ replication_state_.is_unique_origin = false; |
+} |
+ |
} // namespace content |