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

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: moving count variable to private static member 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
« no previous file with comments | « third_party/WebKit/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: 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..b9f234ca58bfb406d2de52a149d9192d8d152f59 100644
--- a/third_party/WebKit/Source/platform/ScriptForbiddenScope.cpp
+++ b/third_party/WebKit/Source/platform/ScriptForbiddenScope.cpp
@@ -8,56 +8,6 @@
namespace blink {
-static unsigned s_scriptForbiddenCount = 0;
+unsigned ScriptForbiddenScope::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
« no previous file with comments | « third_party/WebKit/Source/platform/ScriptForbiddenScope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698