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

Unified Diff: third_party/WebKit/Source/platform/text/CompressibleString.cpp

Issue 1646443002: Remove CompressibleStringImpl::s_isPageBackground (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/text/CompressibleString.cpp
diff --git a/third_party/WebKit/Source/platform/text/CompressibleString.cpp b/third_party/WebKit/Source/platform/text/CompressibleString.cpp
index 1b8ce4120affadd40f68b893ccb000bea8268c5f..38e6c09f41e1978f53a41ac1f73072b8307fd3ce 100644
--- a/third_party/WebKit/Source/platform/text/CompressibleString.cpp
+++ b/third_party/WebKit/Source/platform/text/CompressibleString.cpp
@@ -70,18 +70,11 @@ static inline CompressibleStringTable& compressibleStringTable()
static const unsigned CompressibleStringImplSizeThrehold = 100000;
-bool CompressibleStringImpl::s_isPageBackground = false;
-
void CompressibleStringImpl::compressAll()
{
compressibleStringTable().compressAll();
}
-void CompressibleStringImpl::setPageBackground(bool isPageBackground)
-{
- s_isPageBackground = isPageBackground;
-}
-
CompressibleStringImpl::CompressibleStringImpl(PassRefPtr<StringImpl> impl)
: m_string(impl)
, m_isCompressed(false)
@@ -98,9 +91,8 @@ CompressibleStringImpl::~CompressibleStringImpl()
enum CompressibleStringCountType {
StringWasCompressedInBackgroundTab,
- StringWasDecompressedInBackgroundTab,
- StringWasDecompressedInForegroundTab,
- CompressibleStringCountTypeMax = StringWasDecompressedInForegroundTab,
+ StringWasDecompressed,
+ CompressibleStringCountTypeMax = StringWasDecompressed,
};
static void recordCompressibleStringCount(CompressibleStringCountType type)
@@ -112,7 +104,6 @@ static void recordCompressibleStringCount(CompressibleStringCountType type)
// TODO(hajimehoshi): Implement this.
void CompressibleStringImpl::compressString()
{
- ASSERT(s_isPageBackground);
recordCompressibleStringCount(StringWasCompressedInBackgroundTab);
ASSERT(!isCompressed());
m_isCompressed = true;
@@ -122,11 +113,14 @@ void CompressibleStringImpl::compressString()
// TODO(hajimehoshi): Implement this.
void CompressibleStringImpl::decompressString()
{
- if (s_isPageBackground)
- recordCompressibleStringCount(StringWasDecompressedInBackgroundTab);
- else
- recordCompressibleStringCount(StringWasDecompressedInForegroundTab);
-
+ // TODO(hajimehoshi): We wanted to tell whether decompressing in a
+ // background tab or a foreground tab, but this was impossible. For example,
+ // one renderer process of a new tab page is used for multiple tabs.
+ // Another example is that reloading a page will re-use the process with a
+ // new Page object and updating a static variable along with reloading will
+ // be complex. See also crbug/581266. We will revisit when the situation
+ // changes.
+ recordCompressibleStringCount(StringWasDecompressed);
ASSERT(isCompressed());
m_isCompressed = false;
}

Powered by Google App Engine
This is Rietveld 408576698