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 1430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1441 RefPtrWillBeRawPtr<WebLocalFrameImpl> webFrame = adoptRefWillBeNoop(new WebL
ocalFrameImpl(oldWebFrame, client)); | 1441 RefPtrWillBeRawPtr<WebLocalFrameImpl> webFrame = adoptRefWillBeNoop(new WebL
ocalFrameImpl(oldWebFrame, client)); |
1442 Frame* oldFrame = oldWebFrame->toImplBase()->frame(); | 1442 Frame* oldFrame = oldWebFrame->toImplBase()->frame(); |
1443 webFrame->setParent(oldWebFrame->parent()); | 1443 webFrame->setParent(oldWebFrame->parent()); |
1444 webFrame->setOpener(oldWebFrame->opener()); | 1444 webFrame->setOpener(oldWebFrame->opener()); |
1445 // Note: this *always* temporarily sets a frame owner, even for main frames! | 1445 // Note: this *always* temporarily sets a frame owner, even for main frames! |
1446 // When a core Frame is created with no owner, it attempts to set itself as | 1446 // When a core Frame is created with no owner, it attempts to set itself as |
1447 // the main frame of the Page. However, this is a provisional frame, and may | 1447 // the main frame of the Page. However, this is a provisional frame, and may |
1448 // disappear, so Page::m_mainFrame can't be updated just yet. | 1448 // disappear, so Page::m_mainFrame can't be updated just yet. |
1449 OwnPtrWillBeRawPtr<FrameOwner> tempOwner = DummyFrameOwner::create(); | 1449 OwnPtrWillBeRawPtr<FrameOwner> tempOwner = DummyFrameOwner::create(); |
1450 // TODO(dcheng): This block is very similar to initializeCoreFrame. Try to r
euse it here. | 1450 // TODO(dcheng): This block is very similar to initializeCoreFrame. Try to r
euse it here. |
1451 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(webFrame->m_frameL
oaderClientImpl.get(), oldFrame->host(), tempOwner.get()); | 1451 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(webFrame->m_frameL
oaderClientImpl.get(), oldFrame->host(), tempOwner.get(), client->serviceRegistr
y()); |
1452 // Set the name and unique name directly, bypassing any of the normal logic | 1452 // Set the name and unique name directly, bypassing any of the normal logic |
1453 // to calculate unique name. | 1453 // to calculate unique name. |
1454 frame->tree().setPrecalculatedName(toWebRemoteFrameImpl(oldWebFrame)->frame(
)->tree().name(), toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().uniqueName(
)); | 1454 frame->tree().setPrecalculatedName(toWebRemoteFrameImpl(oldWebFrame)->frame(
)->tree().name(), toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().uniqueName(
)); |
1455 webFrame->setCoreFrame(frame); | 1455 webFrame->setCoreFrame(frame); |
1456 | 1456 |
1457 frame->setOwner(oldFrame->owner()); | 1457 frame->setOwner(oldFrame->owner()); |
1458 | 1458 |
1459 if (frame->owner() && frame->owner()->isRemote()) { | 1459 if (frame->owner() && frame->owner()->isRemote()) { |
1460 toRemoteFrameOwner(frame->owner())->setSandboxFlags(static_cast<SandboxF
lags>(flags)); | 1460 toRemoteFrameOwner(frame->owner())->setSandboxFlags(static_cast<SandboxF
lags>(flags)); |
1461 // Since a remote frame doesn't get the notifications about frame owner | 1461 // Since a remote frame doesn't get the notifications about frame owner |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1566 if (RuntimeEnabledFeatures::wakeLockEnabled()) | 1566 if (RuntimeEnabledFeatures::wakeLockEnabled()) |
1567 ScreenWakeLock::provideTo(*m_frame, m_client ? m_client->wakeLockClient(
) : nullptr); | 1567 ScreenWakeLock::provideTo(*m_frame, m_client ? m_client->wakeLockClient(
) : nullptr); |
1568 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) | 1568 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) |
1569 provideAudioOutputDeviceClientTo(*m_frame, AudioOutputDeviceClientImpl::
create()); | 1569 provideAudioOutputDeviceClientTo(*m_frame, AudioOutputDeviceClientImpl::
create()); |
1570 if (RuntimeEnabledFeatures::installedAppEnabled()) | 1570 if (RuntimeEnabledFeatures::installedAppEnabled()) |
1571 InstalledAppController::provideTo(*m_frame, m_client ? m_client->install
edAppClient() : nullptr); | 1571 InstalledAppController::provideTo(*m_frame, m_client ? m_client->install
edAppClient() : nullptr); |
1572 } | 1572 } |
1573 | 1573 |
1574 void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner,
const AtomicString& name, const AtomicString& uniqueName) | 1574 void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner,
const AtomicString& name, const AtomicString& uniqueName) |
1575 { | 1575 { |
1576 setCoreFrame(LocalFrame::create(m_frameLoaderClientImpl.get(), host, owner))
; | 1576 setCoreFrame(LocalFrame::create(m_frameLoaderClientImpl.get(), host, owner,
client()->serviceRegistry())); |
1577 frame()->tree().setPrecalculatedName(name, uniqueName); | 1577 frame()->tree().setPrecalculatedName(name, uniqueName); |
1578 // We must call init() after m_frame is assigned because it is referenced | 1578 // We must call init() after m_frame is assigned because it is referenced |
1579 // during init(). Note that this may dispatch JS events; the frame may be | 1579 // during init(). Note that this may dispatch JS events; the frame may be |
1580 // detached after init() returns. | 1580 // detached after init() returns. |
1581 frame()->init(); | 1581 frame()->init(); |
1582 } | 1582 } |
1583 | 1583 |
1584 PassRefPtrWillBeRawPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const Fra
meLoadRequest& request, | 1584 PassRefPtrWillBeRawPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const Fra
meLoadRequest& request, |
1585 const AtomicString& name, HTMLFrameOwnerElement* ownerElement) | 1585 const AtomicString& name, HTMLFrameOwnerElement* ownerElement) |
1586 { | 1586 { |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2193 return WebSandboxFlags::None; | 2193 return WebSandboxFlags::None; |
2194 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); | 2194 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); |
2195 } | 2195 } |
2196 | 2196 |
2197 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) | 2197 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) |
2198 { | 2198 { |
2199 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); | 2199 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); |
2200 } | 2200 } |
2201 | 2201 |
2202 } // namespace blink | 2202 } // namespace blink |
OLD | NEW |