diff options
author | Chris Craik <ccraik@google.com> | 2011-07-29 12:33:09 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2011-07-29 12:33:09 -0700 |
commit | 497da5a4386f7ced19a0a26cb136ade3b8fc0373 (patch) | |
tree | 06710a2dc6589c79cf374052a5d5a407ac36ecd9 | |
parent | 14a561b2c1a0d30c36751ea756c773d70c9c4d76 (diff) | |
download | external_webkit-497da5a4386f7ced19a0a26cb136ade3b8fc0373.zip external_webkit-497da5a4386f7ced19a0a26cb136ade3b8fc0373.tar.gz external_webkit-497da5a4386f7ced19a0a26cb136ade3b8fc0373.tar.bz2 |
fixed race condition in tile profiling
bug:5062896
If tile profiling was started, and experienced an inval/tile update it wouldn't
have a place to log it. Added check to make sure it didn't try to store it in
the log vector anyway.
Change-Id: I18f199740a60a86439da141502ea355340bfa8cf
-rw-r--r-- | Source/WebCore/platform/graphics/android/TilesProfiler.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/WebCore/platform/graphics/android/TilesProfiler.cpp b/Source/WebCore/platform/graphics/android/TilesProfiler.cpp index 466923a..653d525 100644 --- a/Source/WebCore/platform/graphics/android/TilesProfiler.cpp +++ b/Source/WebCore/platform/graphics/android/TilesProfiler.cpp @@ -97,7 +97,7 @@ void TilesProfiler::nextFrame(int left, int top, int right, int bottom, float sc m_records.append(WTF::Vector<TileProfileRecord>()); - //first two records designate viewport + //first record designates viewport m_records.last().append(TileProfileRecord( left, top, right, bottom, scale, true, (int)(timeDelta * 1000))); @@ -105,7 +105,7 @@ void TilesProfiler::nextFrame(int left, int top, int right, int bottom, float sc void TilesProfiler::nextTile(BaseTile& tile, float scale, bool inView) { - if (!m_enabled || (m_records.size() > MAX_PROF_FRAMES)) + if (!m_enabled || (m_records.size() > MAX_PROF_FRAMES) || (m_records.size() == 0)) return; bool isReady = tile.isTileReady(); @@ -128,7 +128,7 @@ void TilesProfiler::nextTile(BaseTile& tile, float scale, bool inView) void TilesProfiler::nextInval(const IntRect& rect, float scale) { - if (!m_enabled || (m_records.size() > MAX_PROF_FRAMES)) + if (!m_enabled || (m_records.size() > MAX_PROF_FRAMES) || (m_records.size() == 0)) return; m_records.last().append(TileProfileRecord( |