Skip to content

Commit

Permalink
ASSERT that a null key is never used with FeatureCounter
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=140030

Reviewed by Darin Adler.

* platform/FeatureCounter.cpp:
(WebCore::FeatureCounter::incrementKey):
(WebCore::FeatureCounter::setKey):
* platform/ios/FeatureCounter.mm:
(WebCore::FeatureCounter::incrementKey):
(WebCore::FeatureCounter::setKey):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@177851 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
[email protected] committed Jan 1, 2015
1 parent a4fa24e commit 2a056ab
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
14 changes: 14 additions & 0 deletions Source/WebCore/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
2015-01-01 Chris Dumez <[email protected]>

ASSERT that a null key is never used with FeatureCounter
https://bugs.webkit.org/show_bug.cgi?id=140030

Reviewed by Darin Adler.

* platform/FeatureCounter.cpp:
(WebCore::FeatureCounter::incrementKey):
(WebCore::FeatureCounter::setKey):
* platform/ios/FeatureCounter.mm:
(WebCore::FeatureCounter::incrementKey):
(WebCore::FeatureCounter::setKey):

2015-01-01 Chris Dumez <[email protected]>

[iOS] Fix memory leak in FeatureCounter
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/platform/FeatureCounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ bool FeatureCounter::shouldUseForPage(Page* page)
void FeatureCounter::incrementKey(Page* page, const char* const key)
{
UNUSED_PARAM(page);
UNUSED_PARAM(key);
ASSERT_UNUSED(key, key);
}

void FeatureCounter::setKey(Page* page, const char* const key, int64_t value)
{
UNUSED_PARAM(page);
UNUSED_PARAM(key);
ASSERT_UNUSED(key, key);
UNUSED_PARAM(value);
}

Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/platform/ios/FeatureCounter.mm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

void FeatureCounter::incrementKey(Page* page, const char* const key)
{
ASSERT(key);
if (!shouldUseForPage(page))
return;

Expand All @@ -43,6 +44,7 @@

void FeatureCounter::setKey(Page* page, const char* const key, int64_t value)
{
ASSERT(key);
if (!shouldUseForPage(page))
return;

Expand Down

0 comments on commit 2a056ab

Please sign in to comment.