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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 1670173002: Don't set the origin twice when navigating for javascript: URLs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: steal dcheng's tests Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 // DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL can cause the DocumentLoader to get deref'ed and possible destroyed, 320 // DocumentLoader::replaceDocumentWhileExecutingJavaScriptURL can cause the DocumentLoader to get deref'ed and possible destroyed,
321 // so protect it with a RefPtr. 321 // so protect it with a RefPtr.
322 RefPtrWillBeRawPtr<DocumentLoader> documentLoader(m_frame->document()->loade r()); 322 RefPtrWillBeRawPtr<DocumentLoader> documentLoader(m_frame->document()->loade r());
323 323
324 UseCounter::count(*m_frame->document(), UseCounter::ReplaceDocumentViaJavaSc riptURL); 324 UseCounter::count(*m_frame->document(), UseCounter::ReplaceDocumentViaJavaSc riptURL);
325 325
326 // Prepare a DocumentInit before clearing the frame, because it may need to 326 // Prepare a DocumentInit before clearing the frame, because it may need to
327 // inherit an aliased security context. 327 // inherit an aliased security context.
328 DocumentInit init(m_frame->document()->url(), m_frame); 328 DocumentInit init(m_frame->document()->url(), m_frame);
329 init.withNewRegistrationContext(); 329 init.withNewRegistrationContext();
330 init.withoutInheritingSecurityOrigin();
330 331
331 stopAllLoaders(); 332 stopAllLoaders();
332 // Don't allow any new child frames to load in this frame: attaching a new 333 // Don't allow any new child frames to load in this frame: attaching a new
333 // child frame during or after detaching children results in an attached 334 // child frame during or after detaching children results in an attached
334 // frame on a detached DOM tree, which is bad. 335 // frame on a detached DOM tree, which is bad.
335 SubframeLoadingDisabler disabler(m_frame->document()); 336 SubframeLoadingDisabler disabler(m_frame->document());
336 m_frame->detachChildren(); 337 m_frame->detachChildren();
337 m_frame->document()->detach(); 338 m_frame->document()->detach();
338 clear(); 339 clear();
339 340
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1558 // FIXME: We need a way to propagate insecure requests policy flags to 1559 // FIXME: We need a way to propagate insecure requests policy flags to
1559 // out-of-process frames. For now, we'll always use default behavior. 1560 // out-of-process frames. For now, we'll always use default behavior.
1560 if (!parentFrame->isLocalFrame()) 1561 if (!parentFrame->isLocalFrame())
1561 return nullptr; 1562 return nullptr;
1562 1563
1563 ASSERT(toLocalFrame(parentFrame)->document()); 1564 ASSERT(toLocalFrame(parentFrame)->document());
1564 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ; 1565 return toLocalFrame(parentFrame)->document()->insecureNavigationsToUpgrade() ;
1565 } 1566 }
1566 1567
1567 } // namespace blink 1568 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698