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

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

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 19 matching lines...) Expand all
30 30
31 #ifndef ImageQualityController_h 31 #ifndef ImageQualityController_h
32 #define ImageQualityController_h 32 #define ImageQualityController_h
33 33
34 #include "base/gtest_prod_util.h" 34 #include "base/gtest_prod_util.h"
35 #include "core/CoreExport.h" 35 #include "core/CoreExport.h"
36 #include "platform/Timer.h" 36 #include "platform/Timer.h"
37 #include "platform/geometry/LayoutSize.h" 37 #include "platform/geometry/LayoutSize.h"
38 #include "platform/graphics/Image.h" 38 #include "platform/graphics/Image.h"
39 #include "wtf/HashMap.h" 39 #include "wtf/HashMap.h"
40 #include <memory>
41 40
42 namespace blink { 41 namespace blink {
43 42
44 class LayoutObject; 43 class LayoutObject;
45 44
46 typedef HashMap<const void*, LayoutSize> LayerSizeMap; 45 typedef HashMap<const void*, LayoutSize> LayerSizeMap;
47 46
48 struct ObjectResizeInfo { 47 struct ObjectResizeInfo {
49 LayerSizeMap layerSizeMap; 48 LayerSizeMap layerSizeMap;
50 bool isResizing; 49 bool isResizing;
(...skipping 26 matching lines...) Expand all
77 void objectDestroyed(const LayoutObject&); 76 void objectDestroyed(const LayoutObject&);
78 bool isEmpty() { return m_objectLayerSizeMap.isEmpty(); } 77 bool isEmpty() { return m_objectLayerSizeMap.isEmpty(); }
79 78
80 void highQualityRepaintTimerFired(Timer<ImageQualityController>*); 79 void highQualityRepaintTimerFired(Timer<ImageQualityController>*);
81 void restartTimer(double lastFrameTimeMonotonic); 80 void restartTimer(double lastFrameTimeMonotonic);
82 81
83 // Only for use in testing. 82 // Only for use in testing.
84 void setTimer(Timer<ImageQualityController>*); 83 void setTimer(Timer<ImageQualityController>*);
85 84
86 ObjectLayerSizeMap m_objectLayerSizeMap; 85 ObjectLayerSizeMap m_objectLayerSizeMap;
87 std::unique_ptr<Timer<ImageQualityController>> m_timer; 86 OwnPtr<Timer<ImageQualityController>> m_timer;
88 double m_frameTimeWhenTimerStarted; 87 double m_frameTimeWhenTimerStarted;
89 88
90 // For calling set(). 89 // For calling set().
91 FRIEND_TEST_ALL_PREFIXES(LayoutPartTest, DestroyUpdatesImageQualityControlle r); 90 FRIEND_TEST_ALL_PREFIXES(LayoutPartTest, DestroyUpdatesImageQualityControlle r);
92 91
93 // For calling setTimer(), 92 // For calling setTimer(),
94 FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, LowQualityFilterForResi zingImage); 93 FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, LowQualityFilterForResi zingImage);
95 FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, MediumQualityFilterForN otAnimatedWhileAnotherAnimates); 94 FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, MediumQualityFilterForN otAnimatedWhileAnotherAnimates);
96 FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, DontKickTheAnimationTim erWhenPaintingAtTheSameSize); 95 FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, DontKickTheAnimationTim erWhenPaintingAtTheSameSize);
97 FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, DontRestartTimerUnlessA dvanced); 96 FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, DontRestartTimerUnlessA dvanced);
98 }; 97 };
99 98
100 } // namespace blink 99 } // namespace blink
101 100
102 #endif 101 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698