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

Unified Diff: Source/web/InspectorOverlayImpl.cpp

Issue 1291903003: Oilpan: Move ChromeClient classes into Oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make Page::PageClients STACK_ALLOCATED(). Created 5 years, 4 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
« no previous file with comments | « Source/web/InspectorOverlayImpl.h ('k') | Source/web/WebPagePopupImpl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/InspectorOverlayImpl.cpp
diff --git a/Source/web/InspectorOverlayImpl.cpp b/Source/web/InspectorOverlayImpl.cpp
index c77a18048c2519f289e48ddb1b597fd5ab119d1d..7fa68b4ce0ab7e110cec9cb33c280877eae18c71 100644
--- a/Source/web/InspectorOverlayImpl.cpp
+++ b/Source/web/InspectorOverlayImpl.cpp
@@ -110,12 +110,18 @@ private:
};
-class InspectorOverlayImpl::InspectorOverlayChromeClient final: public EmptyChromeClient {
+class InspectorOverlayImpl::InspectorOverlayChromeClient final : public EmptyChromeClient {
public:
- InspectorOverlayChromeClient(ChromeClient& client, InspectorOverlayImpl& overlay)
- : m_client(client)
- , m_overlay(overlay)
- { }
+ static PassOwnPtrWillBeRawPtr<InspectorOverlayChromeClient> create(ChromeClient& client, InspectorOverlayImpl& overlay)
+ {
+ return adoptPtrWillBeNoop(new InspectorOverlayChromeClient(client, overlay));
+ }
+
+ DEFINE_INLINE_VIRTUAL_TRACE()
+ {
+ visitor->trace(m_overlay);
+ EmptyChromeClient::trace(visitor);
+ }
void setCursor(const Cursor& cursor) override
{
@@ -129,20 +135,25 @@ public:
void invalidateRect(const IntRect&) override
{
- m_overlay.invalidate();
+ m_overlay->invalidate();
}
void scheduleAnimation() override
{
- if (m_overlay.m_inLayout)
+ if (m_overlay->m_inLayout)
return;
m_client.scheduleAnimation();
}
private:
+ InspectorOverlayChromeClient(ChromeClient& client, InspectorOverlayImpl& overlay)
+ : m_client(client)
+ , m_overlay(&overlay)
+ { }
+
ChromeClient& m_client;
haraken 2015/08/14 14:38:41 This needs to be a RawPtrWillBeMember. It is dange
Yuta Kitamura 2015/08/17 08:03:21 Ouch, this was the one I intended to fix, but has
- InspectorOverlayImpl& m_overlay;
+ RawPtrWillBeMember<InspectorOverlayImpl> m_overlay;
};
@@ -177,6 +188,7 @@ DEFINE_TRACE(InspectorOverlayImpl)
visitor->trace(m_highlightNode);
visitor->trace(m_eventTargetNode);
visitor->trace(m_overlayPage);
+ visitor->trace(m_overlayChromeClient);
visitor->trace(m_overlayHost);
visitor->trace(m_listener);
visitor->trace(m_layoutEditor);
@@ -384,7 +396,7 @@ Page* InspectorOverlayImpl::overlayPage()
Page::PageClients pageClients;
fillWithEmptyClients(pageClients);
ASSERT(!m_overlayChromeClient);
- m_overlayChromeClient = adoptPtr(new InspectorOverlayChromeClient(m_webViewImpl->page()->chromeClient(), *this));
+ m_overlayChromeClient = InspectorOverlayChromeClient::create(m_webViewImpl->page()->chromeClient(), *this);
pageClients.chromeClient = m_overlayChromeClient.get();
m_overlayPage = adoptPtrWillBeNoop(new Page(pageClients));
« no previous file with comments | « Source/web/InspectorOverlayImpl.h ('k') | Source/web/WebPagePopupImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698