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

Unified Diff: third_party/WebKit/Source/platform/ScriptForbiddenScope.cpp

Issue 2213903002: Make ScriptForbiddenScope inlineable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: third_party/WebKit/Source/platform/ScriptForbiddenScope.cpp
diff --git a/third_party/WebKit/Source/platform/ScriptForbiddenScope.cpp b/third_party/WebKit/Source/platform/ScriptForbiddenScope.cpp
index 3274d0b1663e01d71559a2f0ce1c7bdb3c4b40a5..4ca3634062a23bfa1a94da16377894c7d48dbf65 100644
--- a/third_party/WebKit/Source/platform/ScriptForbiddenScope.cpp
+++ b/third_party/WebKit/Source/platform/ScriptForbiddenScope.cpp
@@ -8,56 +8,5 @@
namespace blink {
-static unsigned s_scriptForbiddenCount = 0;
-ScriptForbiddenScope::ScriptForbiddenScope()
-{
- enter();
-}
-
-ScriptForbiddenScope::~ScriptForbiddenScope()
-{
- exit();
-}
-
-void ScriptForbiddenScope::enter()
-{
- ASSERT(isMainThread());
- ++s_scriptForbiddenCount;
-}
-
-void ScriptForbiddenScope::exit()
-{
- ASSERT(isMainThread());
- ASSERT(s_scriptForbiddenCount);
- --s_scriptForbiddenCount;
-}
-
-bool ScriptForbiddenScope::isScriptForbidden()
-{
- return isMainThread() && s_scriptForbiddenCount;
-}
-
-ScriptForbiddenScope::AllowUserAgentScript::AllowUserAgentScript()
-{
- if (isMainThread())
- m_change.emplace(&s_scriptForbiddenCount, 0);
-}
-
-ScriptForbiddenScope::AllowUserAgentScript::~AllowUserAgentScript()
-{
- ASSERT(!isMainThread() || !s_scriptForbiddenCount);
-}
-
-ScriptForbiddenIfMainThreadScope::ScriptForbiddenIfMainThreadScope()
-{
- if (isMainThread())
- ScriptForbiddenScope::enter();
-}
-
-ScriptForbiddenIfMainThreadScope::~ScriptForbiddenIfMainThreadScope()
-{
- if (isMainThread())
- ScriptForbiddenScope::exit();
-}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698