Commit 8e830e40 authored by akling@apple.com's avatar akling@apple.com

WebCore: Let Page create the main Frame.

<https://webkit.org/b/119964>

Source/WebCore:

Reviewed by Anders Carlsson.

Previously, Frame::create() would call Page::setMainFrame() when constructing the
main Frame for a Page. Up until that point, Page had a null mainFrame().

To guarantee that Page::mainFrame() is never null, we re-order things so that
Page is responsible for creating its own main Frame. We do this at the earliest
possible point; in the Page constructor initializer list.

Constructing a Frame requires a FrameLoaderClient*, so I've added such a field to
the PageClients struct.

When creating a WebKit-layer frame, we now wrap the already-instantiated
Page::mainFrame() instead of creating a new Frame.

* loader/EmptyClients.cpp:
(WebCore::fillWithEmptyClients):

    Add an EmptyFrameLoaderClient to the PageClients constructed here.

* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::overlayPage):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):

    Updated to wrap Page::mainFrame() in a FrameView instead of creating their
    own Frame manually.

* page/Frame.cpp:
(WebCore::Frame::create):
* page/Page.h:

    Remove Page::setMainFrame() and the only call site.

* page/Page.cpp:
(WebCore::Page::Page):

    Construct Page::m_mainFrame in the initializer list.

(WebCore::Page::PageClients::PageClients):

    Add "FrameLoaderClient* loaderClientForMainFrame" to PageClients.

(WebCore::Page::setNeedsRecalcStyleInAllFrames):

    Null-check the Frame::document() before calling through on it. This would
    otherwise crash when changing font-related Settings before calling init() on
    the Frame (like InspectorOverlay does.)

Source/WebKit/gtk:

Tweak WebKit1/GTK for changes in WebCore.

Patch by Zan Dobersek <zdobersek@igalia.com>
Reviewed by Gustavo Noronha Silva.

* WebCoreSupport/FrameLoaderClientGtk.h:
(WebKit::FrameLoaderClient::setWebFrame):
* webkit/webkitwebframe.cpp:
(webkit_web_frame_new):
* webkit/webkitwebview.cpp:
(webkit_web_view_init):

Source/WebKit/mac:

Reviewed by Anders Carlsson.

* WebCoreSupport/WebFrameLoaderClient.h:
(WebFrameLoaderClient::setWebFrame):

    Make it possible to construct a WebFrameLoaderClient with a null WebFrame*.
    A WebFrame* is later hooked up with a call to setWebFrame().

* WebView/WebFrame.mm:
(+[WebFrame _createMainFrameWithPage:frameName:frameView:]):

    Customized this method to wrap the Page::mainFrame() instead of creating a
    new Frame.

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):

    Add a WebFrameLoaderClient to the PageClients passed to Page().

Source/WebKit2:

Reviewed by Anders Carlsson.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::WebFrameLoaderClient):

    This starts out with a null WebFrame* pointer now.

(WebKit::WebFrameLoaderClient::setWebFrame):

    WebFrame hooks itself up through this as soon as it's constructed.

(WebKit::WebFrameLoaderClient::frameLoaderDestroyed):

    Tweak an out-of-date comment. The ref() we're balancing out comes from
    WebFrame::create().

* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createWithCoreMainFrame):

    Rewrote createMainFrame() as createWithCoreMainFrame(). The new method wraps
    an existing WebCore::Frame instead of creating a new one.

(WebKit::WebFrame::createSubframe):

    Merged WebFrame::init() into here since the logic isn't shared with main
    Frame creation anymore.

(WebKit::WebFrame::create):
(WebKit::WebFrame::WebFrame):

    Call WebFrameLoaderClient::setWebFrame(this).

* WebProcess/WebPage/WebFrame.h:

    WebFrame::m_frameLoaderClient is now an OwnPtr rather than an inline member.
    This way it can be created before the WebFrame.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):

    Set up a WebFrameLoaderClient and pass it to the Page constructor along with
    the other PageClients.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154616 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 613d91e0
2013-08-26 Andreas Kling <akling@apple.com>
WebCore: Let Page create the main Frame.
<https://webkit.org/b/119964>
Reviewed by Anders Carlsson.
Previously, Frame::create() would call Page::setMainFrame() when constructing the
main Frame for a Page. Up until that point, Page had a null mainFrame().
To guarantee that Page::mainFrame() is never null, we re-order things so that
Page is responsible for creating its own main Frame. We do this at the earliest
possible point; in the Page constructor initializer list.
Constructing a Frame requires a FrameLoaderClient*, so I've added such a field to
the PageClients struct.
When creating a WebKit-layer frame, we now wrap the already-instantiated
Page::mainFrame() instead of creating a new Frame.
* loader/EmptyClients.cpp:
(WebCore::fillWithEmptyClients):
Add an EmptyFrameLoaderClient to the PageClients constructed here.
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::overlayPage):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):
Updated to wrap Page::mainFrame() in a FrameView instead of creating their
own Frame manually.
* page/Frame.cpp:
(WebCore::Frame::create):
* page/Page.h:
Remove Page::setMainFrame() and the only call site.
* page/Page.cpp:
(WebCore::Page::Page):
Construct Page::m_mainFrame in the initializer list.
(WebCore::Page::PageClients::PageClients):
Add "FrameLoaderClient* loaderClientForMainFrame" to PageClients.
(WebCore::Page::setNeedsRecalcStyleInAllFrames):
Null-check the Frame::document() before calling through on it. This would
otherwise crash when changing font-related Settings before calling init() on
the Frame (like InspectorOverlay does.)
2013-08-26 Brent Fulgham <bfulgham@apple.com>
[Windows] Unreviewed build fix.
......@@ -431,7 +431,6 @@ Page* InspectorOverlay::overlayPage()
if (m_overlayPage)
return m_overlayPage.get();
static FrameLoaderClient* dummyFrameLoaderClient = new EmptyFrameLoaderClient;
Page::PageClients pageClients;
fillWithEmptyClients(pageClients);
m_overlayPage = adoptPtr(new Page(pageClients));
......@@ -451,7 +450,7 @@ Page* InspectorOverlay::overlayPage()
overlaySettings.setScriptEnabled(true);
overlaySettings.setPluginsEnabled(false);
RefPtr<Frame> frame = Frame::create(m_overlayPage.get(), 0, dummyFrameLoaderClient);
RefPtr<Frame> frame = m_overlayPage->mainFrame();
frame->setView(FrameView::create(frame.get()));
frame->init();
FrameLoader& loader = frame->loader();
......
......@@ -62,6 +62,9 @@ void fillWithEmptyClients(Page::PageClients& pageClients)
static InspectorClient* dummyInspectorClient = adoptPtr(new EmptyInspectorClient).leakPtr();
pageClients.inspectorClient = dummyInspectorClient;
static FrameLoaderClient* dummyFrameLoaderClient = new EmptyFrameLoaderClient;
pageClients.loaderClientForMainFrame = dummyFrameLoaderClient;
}
class EmptyPopupMenu : public PopupMenu {
......
......@@ -204,10 +204,7 @@ inline Frame::Frame(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoader
PassRefPtr<Frame> Frame::create(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClient* client)
{
RefPtr<Frame> frame = adoptRef(new Frame(page, ownerElement, client));
if (!ownerElement)
page->setMainFrame(frame);
return frame.release();
return adoptRef(new Frame(page, ownerElement, client));
}
Frame::~Frame()
......
......@@ -142,6 +142,7 @@ Page::Page(PageClients& pageClients)
, m_settings(Settings::create(this))
, m_progress(ProgressTracker::create())
, m_backForwardController(BackForwardController::create(this, pageClients.backForwardClient))
, m_mainFrame(Frame::create(this, 0, pageClients.loaderClientForMainFrame))
, m_theme(RenderTheme::themeForPage(this))
, m_editorClient(pageClients.editorClient)
, m_plugInClient(pageClients.plugInClient)
......@@ -344,12 +345,6 @@ void Page::setViewMode(ViewMode viewMode)
}
#endif // ENABLE(VIEW_MODE_CSS_MEDIA)
void Page::setMainFrame(PassRefPtr<Frame> mainFrame)
{
ASSERT(!m_mainFrame); // Should only be called during initialization
m_mainFrame = mainFrame;
}
bool Page::openedByDOM() const
{
return m_openedByDOM;
......@@ -485,8 +480,10 @@ void Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment()
void Page::setNeedsRecalcStyleInAllFrames()
{
for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext())
frame->document()->styleResolverChanged(DeferRecalcStyle);
for (Frame* frame = mainFrame(); frame; frame = frame->tree().traverseNext()) {
if (Document* document = frame->document()) {
frame->document()->styleResolverChanged(DeferRecalcStyle);
}
}
void Page::refreshPlugins(bool reload)
......@@ -1596,6 +1593,7 @@ Page::PageClients::PageClients()
, inspectorClient(0)
, plugInClient(0)
, validationMessageClient(0)
, loaderClientForMainFrame(0)
{
}
......
......@@ -68,6 +68,7 @@ class DragController;
class EditorClient;
class FocusController;
class Frame;
class FrameLoaderClient;
class FrameSelection;
class HaltablePlugin;
class HistoryItem;
......@@ -136,6 +137,7 @@ public:
PlugInClient* plugInClient;
RefPtr<BackForwardList> backForwardClient;
ValidationMessageClient* validationMessageClient;
FrameLoaderClient* loaderClientForMainFrame;
};
explicit Page(PageClients&);
......@@ -158,7 +160,6 @@ public:
EditorClient* editorClient() const { return m_editorClient; }
PlugInClient* plugInClient() const { return m_plugInClient; }
void setMainFrame(PassRefPtr<Frame>);
Frame* mainFrame() const { return m_mainFrame.get(); }
bool openedByDOM() const;
......
......@@ -348,8 +348,6 @@ bool SVGImage::dataChanged(bool allDataReceived)
return true;
if (allDataReceived) {
static FrameLoaderClient* dummyFrameLoaderClient = new EmptyFrameLoaderClient;
Page::PageClients pageClients;
fillWithEmptyClients(pageClients);
m_chromeClient = adoptPtr(new SVGImageChromeClient(this));
......@@ -366,7 +364,7 @@ bool SVGImage::dataChanged(bool allDataReceived)
m_page->settings().setScriptEnabled(false);
m_page->settings().setPluginsEnabled(false);
RefPtr<Frame> frame = Frame::create(m_page.get(), 0, dummyFrameLoaderClient);
RefPtr<Frame> frame = m_page->mainFrame();
frame->setView(FrameView::create(frame.get()));
frame->init();
FrameLoader& loader = frame->loader();
......
2013-08-26 Andreas Kling <akling@apple.com>
WebCore: Let Page create the main Frame.
<https://webkit.org/b/119964>
Tweak WebKit1/GTK for changes in WebCore.
Patch by Zan Dobersek <zdobersek@igalia.com>
Reviewed by Gustavo Noronha Silva.
* WebCoreSupport/FrameLoaderClientGtk.h:
(WebKit::FrameLoaderClient::setWebFrame):
* webkit/webkitwebframe.cpp:
(webkit_web_frame_new):
* webkit/webkitwebview.cpp:
(webkit_web_view_init):
2013-08-24 Darin Adler <darin@apple.com>
Frame::tree should return a reference instead of a pointer
......
......@@ -32,19 +32,23 @@
#include "FrameLoaderClient.h"
#include "ResourceResponse.h"
#include "PluginView.h"
#include "webkitwebpolicydecision.h"
typedef struct _WebKitWebFrame WebKitWebFrame;
namespace WebCore {
class PluginView;
}
namespace WebKit {
class FrameLoaderClient : public WebCore::FrameLoaderClient {
public:
FrameLoaderClient(WebKitWebFrame*);
FrameLoaderClient(WebKitWebFrame* = 0);
virtual ~FrameLoaderClient();
virtual void frameLoaderDestroyed();
void setWebFrame(WebKitWebFrame* frame) { m_frame = frame; }
WebKitWebFrame* webFrame() const { return m_frame; }
virtual bool hasWebView() const;
......
......@@ -552,8 +552,8 @@ WebKitWebFrame* webkit_web_frame_new(WebKitWebView* webView)
WebKitWebViewPrivate* viewPriv = webView->priv;
priv->webView = webView;
WebKit::FrameLoaderClient* client = new WebKit::FrameLoaderClient(frame);
priv->coreFrame = Frame::create(viewPriv->corePage, 0, client).get();
priv->coreFrame = viewPriv->corePage->mainFrame();
static_cast<WebKit::FrameLoaderClient*>(viewPriv->corePage->mainFrame()->loader().client())->setWebFrame(frame);
priv->coreFrame->init();
priv->origin = 0;
......
......@@ -57,7 +57,7 @@
#include "FloatQuad.h"
#include "FocusController.h"
#include "FrameLoader.h"
#include "FrameLoaderClient.h"
#include "FrameLoaderClientGtk.h"
#include "FrameLoaderTypes.h"
#include "FrameView.h"
#include "GOwnPtrGtk.h"
......@@ -3763,6 +3763,7 @@ static void webkit_web_view_init(WebKitWebView* webView)
pageClients.dragClient = new WebKit::DragClient(webView);
#endif
pageClients.inspectorClient = new WebKit::InspectorClient(webView);
pageClients.loaderClientForMainFrame = new WebKit::FrameLoaderClient;
priv->corePage = new Page(pageClients);
......
2013-08-26 Andreas Kling <akling@apple.com>
WebCore: Let Page create the main Frame.
<https://webkit.org/b/119964>
Reviewed by Anders Carlsson.
* WebCoreSupport/WebFrameLoaderClient.h:
(WebFrameLoaderClient::setWebFrame):
Make it possible to construct a WebFrameLoaderClient with a null WebFrame*.
A WebFrame* is later hooked up with a call to setWebFrame().
* WebView/WebFrame.mm:
(+[WebFrame _createMainFrameWithPage:frameName:frameView:]):
Customized this method to wrap the Page::mainFrame() instead of creating a
new Frame.
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
Add a WebFrameLoaderClient to the PageClients passed to Page().
2013-08-25 Darin Adler <darin@apple.com>
Frame should not have a documentTypeString member function
......
......@@ -51,8 +51,9 @@ typedef HashMap<RefPtr<WebCore::ResourceLoader>, RetainPtr<WebResource> > Resour
class WebFrameLoaderClient : public WebCore::FrameLoaderClient {
public:
WebFrameLoaderClient(WebFrame*);
WebFrameLoaderClient(WebFrame* = 0);
void setWebFrame(WebFrame* webFrame) { m_webFrame = webFrame; }
WebFrame* webFrame() const { return m_webFrame.get(); }
private:
......
......@@ -283,7 +283,17 @@ WebView *getWebView(WebFrame *webFrame)
+ (void)_createMainFrameWithPage:(Page*)page frameName:(const String&)name frameView:(WebFrameView *)frameView
{
[self _createFrameWithPage:page frameName:name frameView:frameView ownerElement:0];
WebView *webView = kit(page);
WebFrame *frame = [[self alloc] _initWithWebFrameView:frameView webView:webView];
frame->_private->coreFrame = page->mainFrame();
static_cast<WebFrameLoaderClient*>(page->mainFrame()->loader().client())->setWebFrame(frame);
[frame release];
page->mainFrame()->tree()->setName(name);
page->mainFrame()->init();
[webView _setZoomMultiplier:[webView _realZoomMultiplier] isTextOnly:[webView _realZoomMultiplierIsTextOnly]];
}
+ (PassRefPtr<WebCore::Frame>)_createSubframeWithOwnerElement:(HTMLFrameOwnerElement*)ownerElement frameName:(const String&)name frameView:(WebFrameView *)frameView
......
......@@ -61,6 +61,7 @@
#import "WebEditorClient.h"
#import "WebFormDelegatePrivate.h"
#import "WebFrameInternal.h"
#import "WebFrameLoaderClient.h"
#import "WebFrameNetworkingContext.h"
#import "WebFrameViewInternal.h"
#import "WebFullScreenController.h"
......@@ -752,6 +753,7 @@ static bool shouldUseLegacyBackgroundSizeShorthandBehavior()
#endif
pageClients.inspectorClient = new WebInspectorClient(self);
pageClients.alternativeTextClient = new WebAlternativeTextClient(self);
pageClients.loaderClientForMainFrame = new WebFrameLoaderClient;
_private->page = new Page(pageClients);
#if ENABLE(GEOLOCATION)
WebCore::provideGeolocationTo(_private->page, new WebGeolocationClient(self));
......
2013-08-26 Andreas Kling <akling@apple.com>
WebCore: Let Page create the main Frame.
<https://webkit.org/b/119964>
Reviewed by Anders Carlsson.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::WebFrameLoaderClient):
This starts out with a null WebFrame* pointer now.
(WebKit::WebFrameLoaderClient::setWebFrame):
WebFrame hooks itself up through this as soon as it's constructed.
(WebKit::WebFrameLoaderClient::frameLoaderDestroyed):
Tweak an out-of-date comment. The ref() we're balancing out comes from
WebFrame::create().
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::createWithCoreMainFrame):
Rewrote createMainFrame() as createWithCoreMainFrame(). The new method wraps
an existing WebCore::Frame instead of creating a new one.
(WebKit::WebFrame::createSubframe):
Merged WebFrame::init() into here since the logic isn't shared with main
Frame creation anymore.
(WebKit::WebFrame::create):
(WebKit::WebFrame::WebFrame):
Call WebFrameLoaderClient::setWebFrame(this).
* WebProcess/WebPage/WebFrame.h:
WebFrame::m_frameLoaderClient is now an OwnPtr rather than an inline member.
This way it can be created before the WebFrame.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
Set up a WebFrameLoaderClient and pass it to the Page constructor along with
the other PageClients.
2013-08-24 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Add WebKit2 API for isolated worlds
......
......@@ -81,8 +81,8 @@ using namespace WebCore;
namespace WebKit {
WebFrameLoaderClient::WebFrameLoaderClient(WebFrame* frame)
: m_frame(frame)
WebFrameLoaderClient::WebFrameLoaderClient()
: m_frame(0)
, m_hasSentResponseToPluginView(false)
, m_didCompletePageTransitionAlready(false)
, m_frameCameFromPageCache(false)
......@@ -100,7 +100,7 @@ void WebFrameLoaderClient::frameLoaderDestroyed()
m_frame->invalidate();
// Balances explicit ref() in WebFrame::createMainFrame and WebFrame::createSubframe.
// Balances explicit ref() in WebFrame::create().
m_frame->deref();
}
......
......@@ -35,9 +35,10 @@ class WebFrame;
class WebFrameLoaderClient : public WebCore::FrameLoaderClient {
public:
WebFrameLoaderClient(WebFrame*);
WebFrameLoaderClient();
~WebFrameLoaderClient();
void setWebFrame(WebFrame* webFrame) { m_frame = webFrame; }
WebFrame* webFrame() const { return m_frame; }
private:
......
......@@ -102,31 +102,36 @@ static uint64_t generateListenerID()
return uniqueListenerID++;
}
PassRefPtr<WebFrame> WebFrame::createMainFrame(WebPage* page)
PassRefPtr<WebFrame> WebFrame::createWithCoreMainFrame(WebPage* page, WebCore::Frame* coreFrame)
{
RefPtr<WebFrame> frame = create();
RefPtr<WebFrame> frame = create(adoptPtr(static_cast<WebFrameLoaderClient*>(coreFrame->loader().client())));
page->send(Messages::WebPageProxy::DidCreateMainFrame(frame->frameID()));
frame->init(page, String(), 0);
frame->m_coreFrame = coreFrame;
frame->m_coreFrame->tree()->setName(String());
frame->m_coreFrame->init();
return frame.release();
}
PassRefPtr<WebFrame> WebFrame::createSubframe(WebPage* page, const String& frameName, HTMLFrameOwnerElement* ownerElement)
{
RefPtr<WebFrame> frame = create();
RefPtr<WebFrame> frame = create(adoptPtr(new WebFrameLoaderClient));
page->send(Messages::WebPageProxy::DidCreateSubframe(frame->frameID()));
frame->init(page, frameName, ownerElement);
RefPtr<Frame> coreFrame = Frame::create(page->corePage(), ownerElement, frame->m_frameLoaderClient.get());
frame->m_coreFrame = coreFrame.get();
frame->m_coreFrame->tree()->setName(frameName);
if (ownerElement) {
ASSERT(ownerElement->document()->frame());
ownerElement->document()->frame()->tree()->appendChild(coreFrame.release());
}
frame->m_coreFrame->init();
return frame.release();
}
PassRefPtr<WebFrame> WebFrame::create()
PassRefPtr<WebFrame> WebFrame::create(PassOwnPtr<WebFrameLoaderClient> frameLoaderClient)
{
RefPtr<WebFrame> frame = adoptRef(new WebFrame);
RefPtr<WebFrame> frame = adoptRef(new WebFrame(frameLoaderClient));
// Add explict ref() that will be balanced in WebFrameLoaderClient::frameLoaderDestroyed().
frame->ref();
......@@ -134,15 +139,16 @@ PassRefPtr<WebFrame> WebFrame::create()
return frame.release();
}
WebFrame::WebFrame()
WebFrame::WebFrame(PassOwnPtr<WebFrameLoaderClient> frameLoaderClient)
: m_coreFrame(0)
, m_policyListenerID(0)
, m_policyFunction(0)
, m_policyDownloadID(0)
, m_frameLoaderClient(this)
, m_frameLoaderClient(frameLoaderClient)
, m_loadListener(0)
, m_frameID(generateFrameID())
{
m_frameLoaderClient->setWebFrame(this);
WebProcess::shared().addWebFrame(m_frameID, this);
#ifndef NDEBUG
......@@ -159,21 +165,6 @@ WebFrame::~WebFrame()
#endif
}
void WebFrame::init(WebPage* page, const String& frameName, HTMLFrameOwnerElement* ownerElement)
{
RefPtr<Frame> frame = Frame::create(page->corePage(), ownerElement, &m_frameLoaderClient);
m_coreFrame = frame.get();
frame->tree().setName(frameName);
if (ownerElement) {
ASSERT(ownerElement->document()->frame());
ownerElement->document()->frame()->tree().appendChild(frame);
}
frame->init();
}
WebPage* WebFrame::page() const
{
if (!m_coreFrame)
......
......@@ -57,7 +57,7 @@ class WebPage;
class WebFrame : public TypedAPIObject<APIObject::TypeBundleFrame> {
public:
static PassRefPtr<WebFrame> createMainFrame(WebPage*);
static PassRefPtr<WebFrame> createWithCoreMainFrame(WebPage*, WebCore::Frame*);
static PassRefPtr<WebFrame> createSubframe(WebPage*, const String& frameName, WebCore::HTMLFrameOwnerElement*);
~WebFrame();
......@@ -141,10 +141,8 @@ public:
#endif
private:
static PassRefPtr<WebFrame> create();
WebFrame();
void init(WebPage*, const String& frameName, WebCore::HTMLFrameOwnerElement*);
static PassRefPtr<WebFrame> create(PassOwnPtr<WebFrameLoaderClient>);
WebFrame(PassOwnPtr<WebFrameLoaderClient>);
WebCore::Frame* m_coreFrame;
......@@ -152,7 +150,7 @@ private:
WebCore::FramePolicyFunction m_policyFunction;
uint64_t m_policyDownloadID;
WebFrameLoaderClient m_frameLoaderClient;
OwnPtr<WebFrameLoaderClient> m_frameLoaderClient;
LoadListener* m_loadListener;
uint64_t m_frameID;
......
......@@ -63,6 +63,7 @@
#include "WebEvent.h"
#include "WebEventConversion.h"
#include "WebFrame.h"
#include "WebFrameLoaderClient.h"
#include "WebFullScreenManager.h"
#include "WebFullScreenManagerMessages.h"
#include "WebGeolocationClient.h"
......@@ -315,9 +316,15 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
pageClients.alternativeTextClient = new WebAlternativeTextClient(this);
#endif
pageClients.plugInClient = new WebPlugInClient(this);
pageClients.loaderClientForMainFrame = new WebFrameLoaderClient;
m_page = adoptPtr(new Page(pageClients));
m_drawingArea = DrawingArea::create(this, parameters);
m_drawingArea->setPaintingEnabled(false);
m_mainFrame = WebFrame::createWithCoreMainFrame(this, m_page->mainFrame());
#if ENABLE(BATTERY_STATUS)
WebCore::provideBatteryTo(m_page.get(), new WebBatteryClient(this));
#endif
......@@ -348,14 +355,9 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
m_page->setGroupName(m_pageGroup->identifier());
m_page->setDeviceScaleFactor(parameters.deviceScaleFactor);
m_drawingArea = DrawingArea::create(this, parameters);
m_drawingArea->setPaintingEnabled(false);
updatePreferences(parameters.store);
platformInitialize();
m_mainFrame = WebFrame::createMainFrame(this);
setUseFixedLayout(parameters.useFixedLayout);
setDrawsBackground(parameters.drawsBackground);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment