| 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 1512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1523 webFrame->setParent(oldWebFrame->parent()); | 1523 webFrame->setParent(oldWebFrame->parent()); |
| 1524 webFrame->setOpener(oldWebFrame->opener()); | 1524 webFrame->setOpener(oldWebFrame->opener()); |
| 1525 // Note: this *always* temporarily sets a frame owner, even for main frames! | 1525 // Note: this *always* temporarily sets a frame owner, even for main frames! |
| 1526 // When a core Frame is created with no owner, it attempts to set itself as | 1526 // When a core Frame is created with no owner, it attempts to set itself as |
| 1527 // the main frame of the Page. However, this is a provisional frame, and may | 1527 // the main frame of the Page. However, this is a provisional frame, and may |
| 1528 // disappear, so Page::m_mainFrame can't be updated just yet. | 1528 // disappear, so Page::m_mainFrame can't be updated just yet. |
| 1529 FrameOwner* tempOwner = DummyFrameOwner::create(); | 1529 FrameOwner* tempOwner = DummyFrameOwner::create(); |
| 1530 // TODO(dcheng): This block is very similar to initializeCoreFrame. Try to | 1530 // TODO(dcheng): This block is very similar to initializeCoreFrame. Try to |
| 1531 // reuse it here. | 1531 // reuse it here. |
| 1532 LocalFrame* frame = LocalFrame::create(webFrame->m_localFrameClientImpl.get(), | 1532 LocalFrame* frame = LocalFrame::create(webFrame->m_localFrameClientImpl.get(), |
| 1533 oldFrame->host(), tempOwner, | 1533 oldFrame->page(), tempOwner, |
| 1534 interfaceProvider, interfaceRegistry); | 1534 interfaceProvider, interfaceRegistry); |
| 1535 // Set the name and unique name directly, bypassing any of the normal logic | 1535 // Set the name and unique name directly, bypassing any of the normal logic |
| 1536 // to calculate unique name. | 1536 // to calculate unique name. |
| 1537 frame->tree().setPrecalculatedName( | 1537 frame->tree().setPrecalculatedName( |
| 1538 toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().name(), | 1538 toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().name(), |
| 1539 toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().uniqueName()); | 1539 toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().uniqueName()); |
| 1540 webFrame->setCoreFrame(frame); | 1540 webFrame->setCoreFrame(frame); |
| 1541 | 1541 |
| 1542 frame->setOwner(oldFrame->owner()); | 1542 frame->setOwner(oldFrame->owner()); |
| 1543 | 1543 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1603 } | 1603 } |
| 1604 | 1604 |
| 1605 void WebLocalFrameImpl::setCoreFrame(LocalFrame* frame) { | 1605 void WebLocalFrameImpl::setCoreFrame(LocalFrame* frame) { |
| 1606 m_frame = frame; | 1606 m_frame = frame; |
| 1607 } | 1607 } |
| 1608 | 1608 |
| 1609 void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, | 1609 void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, |
| 1610 FrameOwner* owner, | 1610 FrameOwner* owner, |
| 1611 const AtomicString& name, | 1611 const AtomicString& name, |
| 1612 const AtomicString& uniqueName) { | 1612 const AtomicString& uniqueName) { |
| 1613 setCoreFrame(LocalFrame::create(m_localFrameClientImpl.get(), host, owner, | 1613 setCoreFrame(LocalFrame::create(m_localFrameClientImpl.get(), |
| 1614 host ? &host->page() : nullptr, owner, |
| 1614 m_interfaceProvider, m_interfaceRegistry)); | 1615 m_interfaceProvider, m_interfaceRegistry)); |
| 1615 frame()->tree().setPrecalculatedName(name, uniqueName); | 1616 frame()->tree().setPrecalculatedName(name, uniqueName); |
| 1616 // We must call init() after m_frame is assigned because it is referenced | 1617 // We must call init() after m_frame is assigned because it is referenced |
| 1617 // during init(). Note that this may dispatch JS events; the frame may be | 1618 // during init(). Note that this may dispatch JS events; the frame may be |
| 1618 // detached after init() returns. | 1619 // detached after init() returns. |
| 1619 frame()->init(); | 1620 frame()->init(); |
| 1620 if (frame()) { | 1621 if (frame()) { |
| 1621 if (frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument() && | 1622 if (frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument() && |
| 1622 !parent() && !opener() && | 1623 !parent() && !opener() && |
| 1623 frame()->settings()->getShouldReuseGlobalForUnownedMainFrame()) { | 1624 frame()->settings()->getShouldReuseGlobalForUnownedMainFrame()) { |
| (...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2508 createMarkup(startPosition, endPosition, AnnotateForInterchange, | 2509 createMarkup(startPosition, endPosition, AnnotateForInterchange, |
| 2509 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); | 2510 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); |
| 2510 } else { | 2511 } else { |
| 2511 clipHtml = | 2512 clipHtml = |
| 2512 createMarkup(endPosition, startPosition, AnnotateForInterchange, | 2513 createMarkup(endPosition, startPosition, AnnotateForInterchange, |
| 2513 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); | 2514 ConvertBlocksToInlines::NotConvert, ResolveNonLocalURLs); |
| 2514 } | 2515 } |
| 2515 } | 2516 } |
| 2516 | 2517 |
| 2517 } // namespace blink | 2518 } // namespace blink |
| OLD | NEW |