Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2477)

Unified Diff: Source/web/WebViewImpl.cpp

Issue 517043003: Move Frame to the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Back out non-Oilpan experiment + tidy up by adding frame() ref accessors Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 9aa8460eca54bde59d3122c7b2205fa1d39ed686..7f9ae3e1c0d8e9bbcd490915c1b4b41dc7cc7737 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -211,10 +211,10 @@ const double WebView::maxTextSizeMultiplier = 3.0;
// Used to defer all page activity in cases where the embedder wishes to run
// a nested event loop. Using a stack enables nesting of message loop invocations.
-static Vector<ScopedPageLoadDeferrer*>& pageLoadDeferrerStack()
+static WillBeHeapVector<RawPtrWillBeMember<ScopedPageLoadDeferrer> >& pageLoadDeferrerStack()
{
- DEFINE_STATIC_LOCAL(Vector<ScopedPageLoadDeferrer*>, deferrerStack, ());
- return deferrerStack;
+ DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<WillBeHeapVector<RawPtrWillBeMember<ScopedPageLoadDeferrer> > >, deferrerStack, (adoptPtrWillBeNoop(new WillBeHeapVector<RawPtrWillBeMember<ScopedPageLoadDeferrer> > ())));
+ return *deferrerStack;
}
// Ensure that the WebDragOperation enum values stay in sync with the original
@@ -317,7 +317,12 @@ void WebView::didExitModalLoop()
{
ASSERT(pageLoadDeferrerStack().size());
- delete pageLoadDeferrerStack().last();
+ ScopedPageLoadDeferrer* deferrer = pageLoadDeferrerStack().last();
+#if ENABLE(OILPAN)
+ deferrer->dispose();
+#else
+ delete deferrer;
+#endif
pageLoadDeferrerStack().removeLast();
}
@@ -971,7 +976,7 @@ bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event)
return true;
}
- RefPtr<Frame> focusedFrame = focusedCoreFrame();
+ RefPtrWillBeRawPtr<Frame> focusedFrame = focusedCoreFrame();
if (focusedFrame && focusedFrame->isRemoteFrameTemporary()) {
WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(toLocalFrameTemporary(focusedFrame.get()));
webFrame->client()->forwardInputEvent(&event);
@@ -981,7 +986,7 @@ bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event)
if (!focusedFrame || !focusedFrame->isLocalFrame())
return false;
- RefPtr<LocalFrame> frame = toLocalFrame(focusedFrame.get());
+ LocalFrame* frame = toLocalFrame(focusedFrame.get());
PlatformKeyboardEventBuilder evt(event);
@@ -2039,7 +2044,7 @@ void WebViewImpl::setFocus(bool enable)
m_page->focusController().setFocused(enable);
if (enable) {
m_page->focusController().setActive(true);
- RefPtr<Frame> focusedFrame = m_page->focusController().focusedFrame();
+ RefPtrWillBeRawPtr<Frame> focusedFrame = m_page->focusController().focusedFrame();
if (focusedFrame && focusedFrame->isLocalFrame()) {
LocalFrame* localFrame = toLocalFrame(focusedFrame.get());
Element* element = localFrame->document()->focusedElement();
@@ -2072,7 +2077,7 @@ void WebViewImpl::setFocus(bool enable)
if (!frame)
return;
- RefPtr<Frame> focusedFrame = m_page->focusController().focusedFrame();
+ RefPtrWillBeRawPtr<Frame> focusedFrame = m_page->focusController().focusedFrame();
if (focusedFrame && focusedFrame->isLocalFrame()) {
// Finish an ongoing composition to delete the composition node.
if (toLocalFrame(focusedFrame.get())->inputMethodController().hasComposition()) {
@@ -2691,7 +2696,7 @@ void WebViewImpl::setInitialFocus(bool reverse)
void WebViewImpl::clearFocusedElement()
{
- RefPtr<Frame> frame = focusedCoreFrame();
+ RefPtrWillBeRawPtr<Frame> frame = focusedCoreFrame();
if (!frame || !frame->isLocalFrame())
return;

Powered by Google App Engine
This is Rietveld 408576698