Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 1839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1850 if (result.IsEmpty() || !result->IsString()) | 1850 if (result.IsEmpty() || !result->IsString()) |
| 1851 return; | 1851 return; |
| 1852 String scriptResult = toCoreString(v8::Handle<v8::String>::Cast(result)); | 1852 String scriptResult = toCoreString(v8::Handle<v8::String>::Cast(result)); |
| 1853 if (!frame()->navigationScheduler().locationChangePending()) | 1853 if (!frame()->navigationScheduler().locationChangePending()) |
| 1854 frame()->loader().replaceDocumentWhileExecutingJavaScriptURL(scriptResul t, ownerDocument.get()); | 1854 frame()->loader().replaceDocumentWhileExecutingJavaScriptURL(scriptResul t, ownerDocument.get()); |
| 1855 } | 1855 } |
| 1856 | 1856 |
| 1857 void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFra me) | 1857 void WebLocalFrameImpl::initializeToReplaceRemoteFrame(WebRemoteFrame* oldWebFra me) |
| 1858 { | 1858 { |
| 1859 Frame* oldFrame = toCoreFrame(oldWebFrame); | 1859 Frame* oldFrame = toCoreFrame(oldWebFrame); |
| 1860 OwnPtrWillBePersistent<FrameOwner> tempOwner = RemoteBridgeFrameOwner::creat e(nullptr, SandboxNone); | 1860 // Note: this *always* temporarily sets a frame owner, even for main frames! |
|
dcheng
2015/02/23 21:05:12
Btw, is there ever a reason we'd want a stack Pers
haraken
2015/02/24 00:09:07
OwnPtrWillBeRawPtr is a right pointer here.
In un
| |
| 1861 // When a core Frame is created with no owner, it attempts to set itself as | |
| 1862 // the main frame of the Page. However, this is a provisional frame, and may | |
| 1863 // disappear, so Page::m_mainFrame can't be updated just yet. | |
| 1864 OwnPtrWillBeRawPtr<FrameOwner> tempOwner = RemoteBridgeFrameOwner::create(nu llptr, SandboxNone); | |
| 1861 m_frame = LocalFrame::create(&m_frameLoaderClientImpl, oldFrame->host(), tem pOwner.get()); | 1865 m_frame = LocalFrame::create(&m_frameLoaderClientImpl, oldFrame->host(), tem pOwner.get()); |
| 1862 m_frame->setOwner(oldFrame->owner()); | 1866 m_frame->setOwner(oldFrame->owner()); |
| 1863 m_frame->tree().setName(oldFrame->tree().name()); | 1867 m_frame->tree().setName(oldFrame->tree().name()); |
| 1864 setParent(oldWebFrame->parent()); | 1868 setParent(oldWebFrame->parent()); |
| 1865 // We must call init() after m_frame is assigned because it is referenced | 1869 // We must call init() after m_frame is assigned because it is referenced |
| 1866 // during init(). Note that this may dispatch JS events; the frame may be | 1870 // during init(). Note that this may dispatch JS events; the frame may be |
| 1867 // detached after init() returns. | 1871 // detached after init() returns. |
| 1868 m_frame->init(); | 1872 m_frame->init(); |
| 1869 m_frame->loader().stateMachine()->advanceTo(m_frameLoaderClientImpl.backForw ardLength() > 1 ? FrameLoaderStateMachine::CommittedMultipleRealLoads : FrameLoa derStateMachine::CommittedFirstRealLoad); | 1873 m_frame->loader().stateMachine()->advanceTo(m_frameLoaderClientImpl.backForw ardLength() > 1 ? FrameLoaderStateMachine::CommittedMultipleRealLoads : FrameLoa derStateMachine::CommittedFirstRealLoad); |
| 1870 } | 1874 } |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2003 { | 2007 { |
| 2004 m_frameWidget = frameWidget; | 2008 m_frameWidget = frameWidget; |
| 2005 } | 2009 } |
| 2006 | 2010 |
| 2007 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const | 2011 WebFrameWidgetImpl* WebLocalFrameImpl::frameWidget() const |
| 2008 { | 2012 { |
| 2009 return m_frameWidget; | 2013 return m_frameWidget; |
| 2010 } | 2014 } |
| 2011 | 2015 |
| 2012 } // namespace blink | 2016 } // namespace blink |
| OLD | NEW |