| Index: Source/modules/presentation/NavigatorPresentation.cpp
|
| diff --git a/Source/modules/presentation/NavigatorPresentation.cpp b/Source/modules/presentation/NavigatorPresentation.cpp
|
| index 6b5437217ba1db3db5fc34c006435c5b11924a23..a59b55d294fcedf754f840167a87a703870c8b6b 100644
|
| --- a/Source/modules/presentation/NavigatorPresentation.cpp
|
| +++ b/Source/modules/presentation/NavigatorPresentation.cpp
|
| @@ -5,16 +5,12 @@
|
| #include "config.h"
|
| #include "modules/presentation/NavigatorPresentation.h"
|
|
|
| -#include "core/dom/Document.h"
|
| -#include "core/frame/LocalFrame.h"
|
| #include "core/frame/Navigator.h"
|
| #include "modules/presentation/Presentation.h"
|
| -#include "platform/heap/Handle.h"
|
|
|
| namespace blink {
|
|
|
| -NavigatorPresentation::NavigatorPresentation(LocalFrame* frame)
|
| - : DOMWindowProperty(frame)
|
| +NavigatorPresentation::NavigatorPresentation()
|
| {
|
| }
|
|
|
| @@ -33,7 +29,7 @@ NavigatorPresentation& NavigatorPresentation::from(Navigator& navigator)
|
| {
|
| NavigatorPresentation* supplement = static_cast<NavigatorPresentation*>(WillBeHeapSupplement<Navigator>::from(navigator, supplementName()));
|
| if (!supplement) {
|
| - supplement = new NavigatorPresentation(navigator.frame());
|
| + supplement = new NavigatorPresentation();
|
| provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement));
|
| }
|
| return *supplement;
|
| @@ -42,24 +38,19 @@ NavigatorPresentation& NavigatorPresentation::from(Navigator& navigator)
|
| // static
|
| Presentation* NavigatorPresentation::presentation(Navigator& navigator)
|
| {
|
| - return NavigatorPresentation::from(navigator).presentation();
|
| -}
|
| -
|
| -Presentation* NavigatorPresentation::presentation()
|
| -{
|
| - if (!m_presentation) {
|
| - if (!frame())
|
| - return 0;
|
| - m_presentation = Presentation::create(frame()->document());
|
| + NavigatorPresentation& self = NavigatorPresentation::from(navigator);
|
| + if (!self.m_presentation) {
|
| + if (!navigator.frame())
|
| + return nullptr;
|
| + self.m_presentation = Presentation::create(navigator.frame());
|
| }
|
| - return m_presentation.get();
|
| + return self.m_presentation.get();
|
| }
|
|
|
| void NavigatorPresentation::trace(Visitor* visitor)
|
| {
|
| visitor->trace(m_presentation);
|
| WillBeHeapSupplement<Navigator>::trace(visitor);
|
| - DOMWindowProperty::trace(visitor);
|
| }
|
|
|
| } // namespace blink
|
|
|