| 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 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1497 webFrame->setOpener(oldWebFrame->opener()); | 1497 webFrame->setOpener(oldWebFrame->opener()); |
| 1498 // Note: this *always* temporarily sets a frame owner, even for main frames! | 1498 // Note: this *always* temporarily sets a frame owner, even for main frames! |
| 1499 // When a core Frame is created with no owner, it attempts to set itself as | 1499 // When a core Frame is created with no owner, it attempts to set itself as |
| 1500 // the main frame of the Page. However, this is a provisional frame, and may | 1500 // the main frame of the Page. However, this is a provisional frame, and may |
| 1501 // disappear, so Page::m_mainFrame can't be updated just yet. | 1501 // disappear, so Page::m_mainFrame can't be updated just yet. |
| 1502 FrameOwner* tempOwner = DummyFrameOwner::create(); | 1502 FrameOwner* tempOwner = DummyFrameOwner::create(); |
| 1503 // TODO(dcheng): This block is very similar to initializeCoreFrame. Try to | 1503 // TODO(dcheng): This block is very similar to initializeCoreFrame. Try to |
| 1504 // reuse it here. | 1504 // reuse it here. |
| 1505 LocalFrame* frame = LocalFrame::create( | 1505 LocalFrame* frame = LocalFrame::create( |
| 1506 webFrame->m_frameLoaderClientImpl.get(), oldFrame->host(), tempOwner, | 1506 webFrame->m_frameLoaderClientImpl.get(), oldFrame->host(), tempOwner, |
| 1507 client ? client->interfaceProvider() : nullptr); | 1507 client ? client->interfaceProvider() : nullptr, |
| 1508 client ? client->interfaceRegistry() : nullptr); |
| 1508 // Set the name and unique name directly, bypassing any of the normal logic | 1509 // Set the name and unique name directly, bypassing any of the normal logic |
| 1509 // to calculate unique name. | 1510 // to calculate unique name. |
| 1510 frame->tree().setPrecalculatedName( | 1511 frame->tree().setPrecalculatedName( |
| 1511 toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().name(), | 1512 toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().name(), |
| 1512 toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().uniqueName()); | 1513 toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().uniqueName()); |
| 1513 webFrame->setCoreFrame(frame); | 1514 webFrame->setCoreFrame(frame); |
| 1514 | 1515 |
| 1515 frame->setOwner(oldFrame->owner()); | 1516 frame->setOwner(oldFrame->owner()); |
| 1516 | 1517 |
| 1517 if (frame->owner() && frame->owner()->isRemote()) | 1518 if (frame->owner() && frame->owner()->isRemote()) |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1569 void WebLocalFrameImpl::setCoreFrame(LocalFrame* frame) { | 1570 void WebLocalFrameImpl::setCoreFrame(LocalFrame* frame) { |
| 1570 m_frame = frame; | 1571 m_frame = frame; |
| 1571 } | 1572 } |
| 1572 | 1573 |
| 1573 void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, | 1574 void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, |
| 1574 FrameOwner* owner, | 1575 FrameOwner* owner, |
| 1575 const AtomicString& name, | 1576 const AtomicString& name, |
| 1576 const AtomicString& uniqueName) { | 1577 const AtomicString& uniqueName) { |
| 1577 setCoreFrame( | 1578 setCoreFrame( |
| 1578 LocalFrame::create(m_frameLoaderClientImpl.get(), host, owner, | 1579 LocalFrame::create(m_frameLoaderClientImpl.get(), host, owner, |
| 1579 client() ? client()->interfaceProvider() : nullptr)); | 1580 client() ? client()->interfaceProvider() : nullptr, |
| 1581 client() ? client()->interfaceRegistry() : nullptr)); |
| 1580 frame()->tree().setPrecalculatedName(name, uniqueName); | 1582 frame()->tree().setPrecalculatedName(name, uniqueName); |
| 1581 // We must call init() after m_frame is assigned because it is referenced | 1583 // We must call init() after m_frame is assigned because it is referenced |
| 1582 // during init(). Note that this may dispatch JS events; the frame may be | 1584 // during init(). Note that this may dispatch JS events; the frame may be |
| 1583 // detached after init() returns. | 1585 // detached after init() returns. |
| 1584 frame()->init(); | 1586 frame()->init(); |
| 1585 if (frame() && | 1587 if (frame() && |
| 1586 frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument() && | 1588 frame()->loader().stateMachine()->isDisplayingInitialEmptyDocument() && |
| 1587 !parent() && !opener() && | 1589 !parent() && !opener() && |
| 1588 frame()->settings()->shouldReuseGlobalForUnownedMainFrame()) | 1590 frame()->settings()->shouldReuseGlobalForUnownedMainFrame()) |
| 1589 frame()->document()->getSecurityOrigin()->grantUniversalAccess(); | 1591 frame()->document()->getSecurityOrigin()->grantUniversalAccess(); |
| (...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2340 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; | 2342 feature = UseCounter::ChromeLoadTimesNpnNegotiatedProtocol; |
| 2341 } else if (metric == "wasAlternateProtocolAvailable") { | 2343 } else if (metric == "wasAlternateProtocolAvailable") { |
| 2342 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; | 2344 feature = UseCounter::ChromeLoadTimesWasAlternateProtocolAvailable; |
| 2343 } else if (metric == "connectionInfo") { | 2345 } else if (metric == "connectionInfo") { |
| 2344 feature = UseCounter::ChromeLoadTimesConnectionInfo; | 2346 feature = UseCounter::ChromeLoadTimesConnectionInfo; |
| 2345 } | 2347 } |
| 2346 UseCounter::count(frame(), feature); | 2348 UseCounter::count(frame(), feature); |
| 2347 } | 2349 } |
| 2348 | 2350 |
| 2349 } // namespace blink | 2351 } // namespace blink |
| OLD | NEW |