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

Side by Side Diff: third_party/WebKit/Source/web/PageOverlay.cpp

Issue 2149143002: Move PageOverlay::Delegate off the Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mild cleanup Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 10 *
(...skipping 27 matching lines...) Expand all
38 #include "platform/scroll/MainThreadScrollingReason.h" 38 #include "platform/scroll/MainThreadScrollingReason.h"
39 #include "public/platform/WebLayer.h" 39 #include "public/platform/WebLayer.h"
40 #include "public/web/WebViewClient.h" 40 #include "public/web/WebViewClient.h"
41 #include "web/WebDevToolsAgentImpl.h" 41 #include "web/WebDevToolsAgentImpl.h"
42 #include "web/WebViewImpl.h" 42 #include "web/WebViewImpl.h"
43 #include "wtf/PtrUtil.h" 43 #include "wtf/PtrUtil.h"
44 #include <memory> 44 #include <memory>
45 45
46 namespace blink { 46 namespace blink {
47 47
48 std::unique_ptr<PageOverlay> PageOverlay::create(WebViewImpl* viewImpl, PageOver lay::Delegate* delegate) 48 std::unique_ptr<PageOverlay> PageOverlay::create(WebViewImpl* viewImpl, std::uni que_ptr<PageOverlay::Delegate> delegate)
49 { 49 {
50 return wrapUnique(new PageOverlay(viewImpl, delegate)); 50 return wrapUnique(new PageOverlay(viewImpl, std::move(delegate)));
51 } 51 }
52 52
53 PageOverlay::PageOverlay(WebViewImpl* viewImpl, PageOverlay::Delegate* delegate) 53 PageOverlay::PageOverlay(WebViewImpl* viewImpl, std::unique_ptr<PageOverlay::Del egate> delegate)
54 : m_viewImpl(viewImpl) 54 : m_viewImpl(viewImpl)
55 , m_delegate(delegate) 55 , m_delegate(std::move(delegate))
56 { 56 {
57 } 57 }
58 58
59 PageOverlay::~PageOverlay() 59 PageOverlay::~PageOverlay()
60 { 60 {
61 if (!m_layer) 61 if (!m_layer)
62 return; 62 return;
63 63
64 m_layer->removeFromParent(); 64 m_layer->removeFromParent();
65 if (WebDevToolsAgentImpl* devTools = m_viewImpl->mainFrameDevToolsAgentImpl( )) 65 if (WebDevToolsAgentImpl* devTools = m_viewImpl->mainFrameDevToolsAgentImpl( ))
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 DCHECK(m_layer); 115 DCHECK(m_layer);
116 m_delegate->paintPageOverlay(*this, gc, interestRect.size()); 116 m_delegate->paintPageOverlay(*this, gc, interestRect.size());
117 } 117 }
118 118
119 String PageOverlay::debugName(const GraphicsLayer*) const 119 String PageOverlay::debugName(const GraphicsLayer*) const
120 { 120 {
121 return "WebViewImpl Page Overlay Content Layer"; 121 return "WebViewImpl Page Overlay Content Layer";
122 } 122 }
123 123
124 } // namespace blink 124 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/PageOverlay.h ('k') | third_party/WebKit/Source/web/PageOverlayTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698