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

Side by Side Diff: third_party/WebKit/Source/core/layout/ImageQualityController.cpp

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. Created 4 years, 6 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 17 matching lines...) Expand all
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "core/layout/ImageQualityController.h" 31 #include "core/layout/ImageQualityController.h"
32 32
33 #include "core/frame/FrameView.h" 33 #include "core/frame/FrameView.h"
34 #include "core/frame/LocalFrame.h" 34 #include "core/frame/LocalFrame.h"
35 #include "core/frame/Settings.h" 35 #include "core/frame/Settings.h"
36 #include "core/page/ChromeClient.h" 36 #include "core/page/ChromeClient.h"
37 #include "core/page/Page.h" 37 #include "core/page/Page.h"
38 #include "wtf/PtrUtil.h"
38 39
39 namespace blink { 40 namespace blink {
40 41
41 const double ImageQualityController::cLowQualityTimeThreshold = 0.500; // 500 ms 42 const double ImageQualityController::cLowQualityTimeThreshold = 0.500; // 500 ms
42 const double ImageQualityController::cTimerRestartThreshold = 0.250; // 250 ms 43 const double ImageQualityController::cTimerRestartThreshold = 0.250; // 250 ms
43 44
44 static ImageQualityController* gImageQualityController = nullptr; 45 static ImageQualityController* gImageQualityController = nullptr;
45 46
46 ImageQualityController* ImageQualityController::imageQualityController() 47 ImageQualityController* ImageQualityController::imageQualityController()
47 { 48 {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 return InterpolationDefault; 86 return InterpolationDefault;
86 } 87 }
87 88
88 ImageQualityController::~ImageQualityController() 89 ImageQualityController::~ImageQualityController()
89 { 90 {
90 // This will catch users of ImageQualityController that forget to call clean Up. 91 // This will catch users of ImageQualityController that forget to call clean Up.
91 ASSERT(!gImageQualityController || gImageQualityController->isEmpty()); 92 ASSERT(!gImageQualityController || gImageQualityController->isEmpty());
92 } 93 }
93 94
94 ImageQualityController::ImageQualityController() 95 ImageQualityController::ImageQualityController()
95 : m_timer(adoptPtr(new Timer<ImageQualityController>(this, &ImageQualityCont roller::highQualityRepaintTimerFired))) 96 : m_timer(wrapUnique(new Timer<ImageQualityController>(this, &ImageQualityCo ntroller::highQualityRepaintTimerFired)))
96 , m_frameTimeWhenTimerStarted(0.0) 97 , m_frameTimeWhenTimerStarted(0.0)
97 { 98 {
98 } 99 }
99 100
100 void ImageQualityController::setTimer(Timer<ImageQualityController>* newTimer) 101 void ImageQualityController::setTimer(Timer<ImageQualityController>* newTimer)
101 { 102 {
102 m_timer = adoptPtr(newTimer); 103 m_timer = wrapUnique(newTimer);
103 } 104 }
104 105
105 void ImageQualityController::removeLayer(const LayoutObject& object, LayerSizeMa p* innerMap, const void* layer) 106 void ImageQualityController::removeLayer(const LayoutObject& object, LayerSizeMa p* innerMap, const void* layer)
106 { 107 {
107 if (innerMap) { 108 if (innerMap) {
108 innerMap->remove(layer); 109 innerMap->remove(layer);
109 if (innerMap->isEmpty()) 110 if (innerMap->isEmpty())
110 objectDestroyed(object); 111 objectDestroyed(object);
111 } 112 }
112 } 113 }
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 } 221 }
221 // This object has been resized to two different sizes while the timer 222 // This object has been resized to two different sizes while the timer
222 // is active, so draw at low quality, set the flag for animated resizes and 223 // is active, so draw at low quality, set the flag for animated resizes and
223 // the object to the list for high quality redraw. 224 // the object to the list for high quality redraw.
224 set(object, innerMap, layer, layoutSize, true); 225 set(object, innerMap, layer, layoutSize, true);
225 restartTimer(lastFrameTimeMonotonic); 226 restartTimer(lastFrameTimeMonotonic);
226 return true; 227 return true;
227 } 228 }
228 229
229 } // namespace blink 230 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698