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

Unified Diff: Source/platform/ScriptForbiddenScope.cpp

Issue 1315413005: Fix assertion failure in ScriptRegexp::match (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed haraken's comments Created 5 years, 4 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
« no previous file with comments | « Source/platform/ScriptForbiddenScope.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/ScriptForbiddenScope.cpp
diff --git a/Source/platform/ScriptForbiddenScope.cpp b/Source/platform/ScriptForbiddenScope.cpp
index 4b15d045c33ed892aa1d0f615ebe472db47d0184..f0c50c6e688feb1ccf267c4a595973f0ccbd5c8b 100644
--- a/Source/platform/ScriptForbiddenScope.cpp
+++ b/Source/platform/ScriptForbiddenScope.cpp
@@ -44,14 +44,14 @@ bool ScriptForbiddenScope::isScriptForbidden()
}
ScriptForbiddenScope::AllowUserAgentScript::AllowUserAgentScript()
- : m_change(s_scriptForbiddenCount, 0)
{
- ASSERT(isMainThread());
+ if (isMainThread())
+ m_change.emplace(s_scriptForbiddenCount, 0);
}
ScriptForbiddenScope::AllowUserAgentScript::~AllowUserAgentScript()
{
- ASSERT(!s_scriptForbiddenCount);
+ ASSERT(!isMainThread() || !s_scriptForbiddenCount);
}
} // namespace blink
« no previous file with comments | « Source/platform/ScriptForbiddenScope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698