Commit d07d1155 authored by peria@chromium.org's avatar peria@chromium.org

Change pointer type of WebLocalFrameImpl from raw pointers to RefPtrWillBePersistent

in WebEmbeddedWorkerImpl and WebSharedWorkerImpl.


Those member variables are instantiated with WebLocalFrame::create(),
and it actually creates a WebLocalFrameImpl instance.

On Oilpan build, WebLocalFrameImpl has a self-referential persistent to
keep itself alive, and it will be cleared on call of
WebLocalFrameImpl::close().

In those two classes, m_mainFrame->close() is called in destructors, so
the self referential persistent is cleared in destruction on Oilpan build.
Beside it, on both non-Oilpan build and Oilpan build, m_mainFrame is
also cleared and should be released.


BUG=509911

Review URL: https://codereview.chromium.org/1308313002

git-svn-id: svn://svn.chromium.org/blink/trunk@201191 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent bb09c78a
...@@ -84,8 +84,8 @@ WebEmbeddedWorkerImpl::WebEmbeddedWorkerImpl(PassOwnPtr<WebServiceWorkerContextC ...@@ -84,8 +84,8 @@ WebEmbeddedWorkerImpl::WebEmbeddedWorkerImpl(PassOwnPtr<WebServiceWorkerContextC
: m_workerContextClient(client) : m_workerContextClient(client)
, m_contentSettingsClient(ContentSettingsClient) , m_contentSettingsClient(ContentSettingsClient)
, m_workerInspectorProxy(WorkerInspectorProxy::create()) , m_workerInspectorProxy(WorkerInspectorProxy::create())
, m_webView(0) , m_webView(nullptr)
, m_mainFrame(0) , m_mainFrame(nullptr)
, m_loadingShadowPage(false) , m_loadingShadowPage(false)
, m_askedToTerminate(false) , m_askedToTerminate(false)
, m_waitingForDebuggerState(NotWaitingForDebugger) , m_waitingForDebuggerState(NotWaitingForDebugger)
...@@ -219,7 +219,7 @@ void WebEmbeddedWorkerImpl::prepareShadowPageForLoader() ...@@ -219,7 +219,7 @@ void WebEmbeddedWorkerImpl::prepareShadowPageForLoader()
settings->setAllowDisplayOfInsecureContent(false); settings->setAllowDisplayOfInsecureContent(false);
settings->setAllowRunningOfInsecureContent(false); settings->setAllowRunningOfInsecureContent(false);
m_mainFrame = toWebLocalFrameImpl(WebLocalFrame::create(WebTreeScopeType::Document, this)); m_mainFrame = toWebLocalFrameImpl(WebLocalFrame::create(WebTreeScopeType::Document, this));
m_webView->setMainFrame(m_mainFrame); m_webView->setMainFrame(m_mainFrame.get());
m_mainFrame->setDevToolsAgentClient(this); m_mainFrame->setDevToolsAgentClient(this);
// If we were asked to wait for debugger then it is the good time to do that. // If we were asked to wait for debugger then it is the good time to do that.
......
...@@ -115,7 +115,7 @@ private: ...@@ -115,7 +115,7 @@ private:
// deref'ed) when this EmbeddedWorkerImpl is destructed, therefore they // deref'ed) when this EmbeddedWorkerImpl is destructed, therefore they
// are guaranteed to exist while this object is around. // are guaranteed to exist while this object is around.
WebView* m_webView; WebView* m_webView;
WebLocalFrameImpl* m_mainFrame; RefPtrWillBePersistent<WebLocalFrameImpl> m_mainFrame;
bool m_loadingShadowPage; bool m_loadingShadowPage;
bool m_askedToTerminate; bool m_askedToTerminate;
......
...@@ -81,8 +81,8 @@ namespace blink { ...@@ -81,8 +81,8 @@ namespace blink {
// possible. // possible.
WebSharedWorkerImpl::WebSharedWorkerImpl(WebSharedWorkerClient* client) WebSharedWorkerImpl::WebSharedWorkerImpl(WebSharedWorkerClient* client)
: m_webView(0) : m_webView(nullptr)
, m_mainFrame(0) , m_mainFrame(nullptr)
, m_askedToTerminate(false) , m_askedToTerminate(false)
, m_workerInspectorProxy(WorkerInspectorProxy::create()) , m_workerInspectorProxy(WorkerInspectorProxy::create())
, m_client(client) , m_client(client)
...@@ -133,7 +133,7 @@ void WebSharedWorkerImpl::initializeLoader() ...@@ -133,7 +133,7 @@ void WebSharedWorkerImpl::initializeLoader()
// FIXME: Settings information should be passed to the Worker process from Browser process when the worker // FIXME: Settings information should be passed to the Worker process from Browser process when the worker
// is created (similar to RenderThread::OnCreateNewView). // is created (similar to RenderThread::OnCreateNewView).
m_mainFrame = toWebLocalFrameImpl(WebLocalFrame::create(WebTreeScopeType::Document, this)); m_mainFrame = toWebLocalFrameImpl(WebLocalFrame::create(WebTreeScopeType::Document, this));
m_webView->setMainFrame(m_mainFrame); m_webView->setMainFrame(m_mainFrame.get());
m_mainFrame->setDevToolsAgentClient(this); m_mainFrame->setDevToolsAgentClient(this);
// If we were asked to pause worker context on start and wait for debugger then it is the good time to do that. // If we were asked to pause worker context on start and wait for debugger then it is the good time to do that.
......
...@@ -137,7 +137,7 @@ private: ...@@ -137,7 +137,7 @@ private:
// 'shadow page' - created to proxy loading requests from the worker. // 'shadow page' - created to proxy loading requests from the worker.
RefPtrWillBePersistent<ExecutionContext> m_loadingDocument; RefPtrWillBePersistent<ExecutionContext> m_loadingDocument;
WebView* m_webView; WebView* m_webView;
WebLocalFrameImpl* m_mainFrame; RefPtrWillBePersistent<WebLocalFrameImpl> m_mainFrame;
bool m_askedToTerminate; bool m_askedToTerminate;
// This one is bound to and used only on the main thread. // This one is bound to and used only on the main thread.
......
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