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 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 RefPtrWillBeRawPtr<WebLocalFrameImpl> webFrame = adoptRefWillBeNoop(new WebL
ocalFrameImpl(oldWebFrame, client)); | 1418 RefPtrWillBeRawPtr<WebLocalFrameImpl> webFrame = adoptRefWillBeNoop(new WebL
ocalFrameImpl(oldWebFrame, client)); |
1419 Frame* oldFrame = oldWebFrame->toImplBase()->frame(); | 1419 Frame* oldFrame = oldWebFrame->toImplBase()->frame(); |
1420 webFrame->setParent(oldWebFrame->parent()); | 1420 webFrame->setParent(oldWebFrame->parent()); |
1421 webFrame->setOpener(oldWebFrame->opener()); | 1421 webFrame->setOpener(oldWebFrame->opener()); |
1422 // Note: this *always* temporarily sets a frame owner, even for main frames! | 1422 // Note: this *always* temporarily sets a frame owner, even for main frames! |
1423 // When a core Frame is created with no owner, it attempts to set itself as | 1423 // When a core Frame is created with no owner, it attempts to set itself as |
1424 // the main frame of the Page. However, this is a provisional frame, and may | 1424 // the main frame of the Page. However, this is a provisional frame, and may |
1425 // disappear, so Page::m_mainFrame can't be updated just yet. | 1425 // disappear, so Page::m_mainFrame can't be updated just yet. |
1426 OwnPtrWillBeRawPtr<FrameOwner> tempOwner = DummyFrameOwner::create(); | 1426 OwnPtrWillBeRawPtr<FrameOwner> tempOwner = DummyFrameOwner::create(); |
1427 // TODO(dcheng): This block is very similar to initializeCoreFrame. Try to r
euse it here. | 1427 // TODO(dcheng): This block is very similar to initializeCoreFrame. Try to r
euse it here. |
1428 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(webFrame->m_frameL
oaderClientImpl.get(), oldFrame->host(), tempOwner.get()); | 1428 RefPtrWillBeRawPtr<LocalFrame> frame = LocalFrame::create(webFrame->m_frameL
oaderClientImpl.get(), oldFrame->host(), tempOwner.get(), client->serviceRegistr
y()); |
1429 // Set the name and unique name directly, bypassing any of the normal logic | 1429 // Set the name and unique name directly, bypassing any of the normal logic |
1430 // to calculate unique name. | 1430 // to calculate unique name. |
1431 frame->tree().setPrecalculatedName(toWebRemoteFrameImpl(oldWebFrame)->frame(
)->tree().name(), toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().uniqueName(
)); | 1431 frame->tree().setPrecalculatedName(toWebRemoteFrameImpl(oldWebFrame)->frame(
)->tree().name(), toWebRemoteFrameImpl(oldWebFrame)->frame()->tree().uniqueName(
)); |
1432 webFrame->setCoreFrame(frame); | 1432 webFrame->setCoreFrame(frame); |
1433 | 1433 |
1434 frame->setOwner(oldFrame->owner()); | 1434 frame->setOwner(oldFrame->owner()); |
1435 | 1435 |
1436 if (frame->owner() && frame->owner()->isRemote()) { | 1436 if (frame->owner() && frame->owner()->isRemote()) { |
1437 toRemoteFrameOwner(frame->owner())->setSandboxFlags(static_cast<SandboxF
lags>(flags)); | 1437 toRemoteFrameOwner(frame->owner())->setSandboxFlags(static_cast<SandboxF
lags>(flags)); |
1438 // Since a remote frame doesn't get the notifications about frame owner | 1438 // 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... |
1543 if (RuntimeEnabledFeatures::wakeLockEnabled()) | 1543 if (RuntimeEnabledFeatures::wakeLockEnabled()) |
1544 ScreenWakeLock::provideTo(*m_frame, m_client ? m_client->wakeLockClient(
) : nullptr); | 1544 ScreenWakeLock::provideTo(*m_frame, m_client ? m_client->wakeLockClient(
) : nullptr); |
1545 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) | 1545 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) |
1546 provideAudioOutputDeviceClientTo(*m_frame, AudioOutputDeviceClientImpl::
create()); | 1546 provideAudioOutputDeviceClientTo(*m_frame, AudioOutputDeviceClientImpl::
create()); |
1547 if (RuntimeEnabledFeatures::installedAppEnabled()) | 1547 if (RuntimeEnabledFeatures::installedAppEnabled()) |
1548 InstalledAppController::provideTo(*m_frame, m_client ? m_client->install
edAppClient() : nullptr); | 1548 InstalledAppController::provideTo(*m_frame, m_client ? m_client->install
edAppClient() : nullptr); |
1549 } | 1549 } |
1550 | 1550 |
1551 void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner,
const AtomicString& name, const AtomicString& uniqueName) | 1551 void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner,
const AtomicString& name, const AtomicString& uniqueName) |
1552 { | 1552 { |
1553 setCoreFrame(LocalFrame::create(m_frameLoaderClientImpl.get(), host, owner))
; | 1553 setCoreFrame(LocalFrame::create(m_frameLoaderClientImpl.get(), host, owner,
client()->serviceRegistry())); |
1554 frame()->tree().setPrecalculatedName(name, uniqueName); | 1554 frame()->tree().setPrecalculatedName(name, uniqueName); |
1555 // We must call init() after m_frame is assigned because it is referenced | 1555 // We must call init() after m_frame is assigned because it is referenced |
1556 // during init(). Note that this may dispatch JS events; the frame may be | 1556 // during init(). Note that this may dispatch JS events; the frame may be |
1557 // detached after init() returns. | 1557 // detached after init() returns. |
1558 frame()->init(); | 1558 frame()->init(); |
1559 } | 1559 } |
1560 | 1560 |
1561 PassRefPtrWillBeRawPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const Fra
meLoadRequest& request, | 1561 PassRefPtrWillBeRawPtr<LocalFrame> WebLocalFrameImpl::createChildFrame(const Fra
meLoadRequest& request, |
1562 const AtomicString& name, HTMLFrameOwnerElement* ownerElement) | 1562 const AtomicString& name, HTMLFrameOwnerElement* ownerElement) |
1563 { | 1563 { |
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2170 return WebSandboxFlags::None; | 2170 return WebSandboxFlags::None; |
2171 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); | 2171 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); |
2172 } | 2172 } |
2173 | 2173 |
2174 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) | 2174 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) |
2175 { | 2175 { |
2176 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); | 2176 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); |
2177 } | 2177 } |
2178 | 2178 |
2179 } // namespace blink | 2179 } // namespace blink |
OLD | NEW |