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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp

Issue 2680843006: Tidy DEFINE_(THREAD_SAFE_)STATIC_LOCAL() implementations. (Closed)
Patch Set: explain safety of HTMLTableSectionElement singletons Created 3 years, 10 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/core/layout/LayoutTestHelper.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp b/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp
index 06ccad5ce8ecced663480da4a992f7ba31e06e72..685e0dd7ef0efe426b23ea5803e1ae947753b072 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTestHelper.cpp
@@ -32,7 +32,12 @@ void FrameLoaderClientWithParent::detached(FrameDetachType) {
}
ChromeClient& RenderingTest::chromeClient() const {
- DEFINE_STATIC_LOCAL(EmptyChromeClient, client, (EmptyChromeClient::create()));
+ // |ChromeClient| contains a weak reference to a |Node| (which derives
+ // from |ScriptWrappable|). That reference is only used for unit testing
+ // purposes and will not accidentally leak between contexts. Consequently,
+ // disable the singleton verification check.
+ DEFINE_STATIC_LOCAL(EmptyChromeClient, client, (EmptyChromeClient::create()),
+ CheckScriptWrappable::No);
return client;
}

Powered by Google App Engine
This is Rietveld 408576698