Title: [180738] releases/WebKitGTK/webkit-2.8/Source/WebCore
- Revision
- 180738
- Author
- [email protected]
- Date
- 2015-02-27 04:03:41 -0800 (Fri, 27 Feb 2015)
Log Message
Merge r180244 - Slight CachedPage class clean up
https://bugs.webkit.org/show_bug.cgi?id=141693
Reviewed by Andreas Kling.
Slight CachedPage class clean up:
- Drop unnecessary m_timeStamp data member
- Protect m_needsCaptionPreferencesChanged data member with
#if ENABLE(VIDEO_TRACK)
- Merge destroy() method into the destructor as this is the
only caller
- Update clear() to reset 2 data members that were missing
Modified Paths
Diff
Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog (180737 => 180738)
--- releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog 2015-02-27 12:00:38 UTC (rev 180737)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog 2015-02-27 12:03:41 UTC (rev 180738)
@@ -1,3 +1,18 @@
+2015-02-17 Chris Dumez <[email protected]>
+
+ Slight CachedPage class clean up
+ https://bugs.webkit.org/show_bug.cgi?id=141693
+
+ Reviewed by Andreas Kling.
+
+ Slight CachedPage class clean up:
+ - Drop unnecessary m_timeStamp data member
+ - Protect m_needsCaptionPreferencesChanged data member with
+ #if ENABLE(VIDEO_TRACK)
+ - Merge destroy() method into the destructor as this is the
+ only caller
+ - Update clear() to reset 2 data members that were missing
+
2015-02-17 Carlos Garcia Campos <[email protected]>
Use HashMap::add instead of get/contains + set in DOMObjectCache
Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/history/CachedPage.cpp (180737 => 180738)
--- releases/WebKitGTK/webkit-2.8/Source/WebCore/history/CachedPage.cpp 2015-02-27 12:00:38 UTC (rev 180737)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/history/CachedPage.cpp 2015-02-27 12:03:41 UTC (rev 180738)
@@ -50,12 +50,13 @@
DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, cachedPageCounter, ("CachedPage"));
CachedPage::CachedPage(Page& page)
- : m_timeStamp(monotonicallyIncreasingTime())
- , m_expirationTime(m_timeStamp + page.settings().backForwardCacheExpirationInterval())
+ : m_expirationTime(monotonicallyIncreasingTime() + page.settings().backForwardCacheExpirationInterval())
, m_cachedMainFrame(std::make_unique<CachedFrame>(page.mainFrame()))
, m_needStyleRecalcForVisitedLinks(false)
, m_needsFullStyleRecalc(false)
+#if ENABLE(VIDEO_TRACK)
, m_needsCaptionPreferencesChanged(false)
+#endif
, m_needsDeviceScaleChanged(false)
{
#ifndef NDEBUG
@@ -69,8 +70,8 @@
cachedPageCounter.decrement();
#endif
- destroy();
- ASSERT(!m_cachedMainFrame);
+ if (m_cachedMainFrame)
+ m_cachedMainFrame->destroy();
}
void CachedPage::restore(Page& page)
@@ -110,9 +111,8 @@
frame->document()->visitedLinkState().invalidateStyleForAllLinks();
}
- if (m_needsDeviceScaleChanged) {
+ if (m_needsDeviceScaleChanged)
page.mainFrame().deviceOrPageScaleFactorChanged();
- }
if (m_needsFullStyleRecalc)
page.setNeedsRecalcStyleInAllFrames();
@@ -129,19 +129,15 @@
{
ASSERT(m_cachedMainFrame);
m_cachedMainFrame->clear();
- m_cachedMainFrame = 0;
+ m_cachedMainFrame = nullptr;
m_needStyleRecalcForVisitedLinks = false;
m_needsFullStyleRecalc = false;
+#if ENABLE(VIDEO_TRACK)
+ m_needsCaptionPreferencesChanged = false;
+#endif
+ m_needsDeviceScaleChanged = false;
}
-void CachedPage::destroy()
-{
- if (m_cachedMainFrame)
- m_cachedMainFrame->destroy();
-
- m_cachedMainFrame = 0;
-}
-
bool CachedPage::hasExpired() const
{
return monotonicallyIncreasingTime() > m_expirationTime;
Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/history/CachedPage.h (180737 => 180738)
--- releases/WebKitGTK/webkit-2.8/Source/WebCore/history/CachedPage.h 2015-02-27 12:00:38 UTC (rev 180737)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/history/CachedPage.h 2015-02-27 12:03:41 UTC (rev 180738)
@@ -29,7 +29,7 @@
#include "CachedFrame.h"
namespace WebCore {
-
+
class Document;
class DocumentLoader;
class Page;
@@ -45,7 +45,6 @@
Document* document() const { return m_cachedMainFrame->document(); }
DocumentLoader* documentLoader() const { return m_cachedMainFrame->documentLoader(); }
- double timeStamp() const { return m_timeStamp; }
bool hasExpired() const;
CachedFrame* cachedMainFrame() { return m_cachedMainFrame.get(); }
@@ -59,14 +58,13 @@
void markForDeviceScaleChanged() { m_needsDeviceScaleChanged = true; }
private:
- void destroy();
-
- double m_timeStamp;
double m_expirationTime;
std::unique_ptr<CachedFrame> m_cachedMainFrame;
bool m_needStyleRecalcForVisitedLinks;
bool m_needsFullStyleRecalc;
+#if ENABLE(VIDEO_TRACK)
bool m_needsCaptionPreferencesChanged;
+#endif
bool m_needsDeviceScaleChanged;
};
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes