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

Unified Diff: Source/core/loader/FrameFetchContextTest.cpp

Issue 1306793003: Oilpan: Move FrameLoaderClient class hierarchy into Oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/core/loader/EmptyClients.h ('k') | Source/core/page/PrintContextTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FrameFetchContextTest.cpp
diff --git a/Source/core/loader/FrameFetchContextTest.cpp b/Source/core/loader/FrameFetchContextTest.cpp
index 23d2a8f4a4c4594d3ad2643dd1922b15f5294d2b..75ae5c2da912923f1797d4be95218dc7c2d1b976 100644
--- a/Source/core/loader/FrameFetchContextTest.cpp
+++ b/Source/core/loader/FrameFetchContextTest.cpp
@@ -323,17 +323,28 @@ TEST_F(FrameFetchContextHintsTest, MonitorAllHints)
expectHeader("http://www.example.com/1.gif", "Viewport-Width", true, "500");
}
-class StubFrameLoaderClientWithParent : public EmptyFrameLoaderClient {
+class StubFrameLoaderClientWithParent final : public EmptyFrameLoaderClient {
public:
- explicit StubFrameLoaderClientWithParent(Frame* parent)
- : m_parent(parent)
+ static PassOwnPtrWillBeRawPtr<StubFrameLoaderClientWithParent> create(Frame* parent)
+ {
+ return adoptPtrWillBeNoop(new StubFrameLoaderClientWithParent(parent));
+ }
+
+ DEFINE_INLINE_VIRTUAL_TRACE()
{
+ visitor->trace(m_parent);
+ EmptyFrameLoaderClient::trace(visitor);
}
- Frame* parent() const override { return m_parent; }
+ Frame* parent() const override { return m_parent.get(); }
private:
- Frame* m_parent;
+ explicit StubFrameLoaderClientWithParent(Frame* parent)
+ : m_parent(parent)
+ {
+ }
+
+ RawPtrWillBeMember<Frame> m_parent;
};
class StubFrameOwner : public NoBaseWillBeGarbageCollectedFinalized<StubFrameOwner>, public FrameOwner {
@@ -408,9 +419,9 @@ TEST_F(FrameFetchContextCachePolicyTest, MainResource)
EXPECT_EQ(ReloadIgnoringCacheData, fetchContext->resourceRequestCachePolicy(conditional, Resource::MainResource));
// Set up a child frame
- StubFrameLoaderClientWithParent client(document->frame());
+ OwnPtrWillBeRawPtr<StubFrameLoaderClientWithParent> client = StubFrameLoaderClientWithParent::create(document->frame());
StubFrameOwner owner;
- RefPtrWillBeRawPtr<LocalFrame> childFrame = LocalFrame::create(&client, document->frame()->host(), &owner);
+ RefPtrWillBeRawPtr<LocalFrame> childFrame = LocalFrame::create(client.get(), document->frame()->host(), &owner);
childFrame->setView(FrameView::create(childFrame.get(), IntSize(500, 500)));
childFrame->init();
RefPtrWillBePersistent<DocumentLoader> childDocumentLoader =
« no previous file with comments | « Source/core/loader/EmptyClients.h ('k') | Source/core/page/PrintContextTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698