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

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.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
« no previous file with comments | « third_party/WebKit/Source/web/PageOverlayTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 } 308 }
309 }; 309 };
310 310
311 class ColorOverlay final : public PageOverlay::Delegate { 311 class ColorOverlay final : public PageOverlay::Delegate {
312 public: 312 public:
313 explicit ColorOverlay(WebColor color) 313 explicit ColorOverlay(WebColor color)
314 : m_color(color) 314 : m_color(color)
315 { 315 {
316 } 316 }
317 317
318 virtual ~ColorOverlay()
319 {
320 }
321
322 private: 318 private:
323 void paintPageOverlay(const PageOverlay& pageOverlay, GraphicsContext& graph icsContext, const WebSize& size) const override 319 void paintPageOverlay(const PageOverlay& pageOverlay, GraphicsContext& graph icsContext, const WebSize& size) const override
324 { 320 {
325 if (DrawingRecorder::useCachedDrawingIfPossible(graphicsContext, pageOve rlay, DisplayItem::PageOverlay)) 321 if (DrawingRecorder::useCachedDrawingIfPossible(graphicsContext, pageOve rlay, DisplayItem::PageOverlay))
326 return; 322 return;
327 FloatRect rect(0, 0, size.width, size.height); 323 FloatRect rect(0, 0, size.width, size.height);
328 DrawingRecorder drawingRecorder(graphicsContext, pageOverlay, DisplayIte m::PageOverlay, rect); 324 DrawingRecorder drawingRecorder(graphicsContext, pageOverlay, DisplayIte m::PageOverlay, rect);
329 graphicsContext.fillRect(rect, m_color); 325 graphicsContext.fillRect(rect, m_color);
330 } 326 }
331 327
(...skipping 3815 matching lines...) Expand 10 before | Expand all | Expand 10 after
4147 } 4143 }
4148 4144
4149 void WebViewImpl::setPageOverlayColor(WebColor color) 4145 void WebViewImpl::setPageOverlayColor(WebColor color)
4150 { 4146 {
4151 if (m_pageColorOverlay) 4147 if (m_pageColorOverlay)
4152 m_pageColorOverlay.reset(); 4148 m_pageColorOverlay.reset();
4153 4149
4154 if (color == Color::transparent) 4150 if (color == Color::transparent)
4155 return; 4151 return;
4156 4152
4157 m_pageColorOverlay = PageOverlay::create(this, new ColorOverlay(color)); 4153 m_pageColorOverlay = PageOverlay::create(this, wrapUnique(new ColorOverlay(c olor)));
4158 m_pageColorOverlay->update(); 4154 m_pageColorOverlay->update();
4159 } 4155 }
4160 4156
4161 WebPageImportanceSignals* WebViewImpl::pageImportanceSignals() 4157 WebPageImportanceSignals* WebViewImpl::pageImportanceSignals()
4162 { 4158 {
4163 return &m_pageImportanceSignals; 4159 return &m_pageImportanceSignals;
4164 } 4160 }
4165 4161
4166 Element* WebViewImpl::focusedElement() const 4162 Element* WebViewImpl::focusedElement() const
4167 { 4163 {
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
4616 return nullptr; 4612 return nullptr;
4617 return focusedFrame; 4613 return focusedFrame;
4618 } 4614 }
4619 4615
4620 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const 4616 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const
4621 { 4617 {
4622 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4618 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4623 } 4619 }
4624 4620
4625 } // namespace blink 4621 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/PageOverlayTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698