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

Side by Side Diff: third_party/WebKit/Source/platform/PluginScriptForbiddenScope.cpp

Issue 1818233003: Merge WTF::initializeMainThread into WTF::initialize (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/PluginScriptForbiddenScope.h" 5 #include "platform/PluginScriptForbiddenScope.h"
6 6
7 #include "wtf/Assertions.h" 7 #include "wtf/Assertions.h"
8 #include "wtf/MainThread.h"
9 8
10 namespace blink { 9 namespace blink {
11 10
12 static unsigned s_pluginScriptForbiddenCount = 0; 11 static unsigned s_pluginScriptForbiddenCount = 0;
13 12
14 PluginScriptForbiddenScope::PluginScriptForbiddenScope() 13 PluginScriptForbiddenScope::PluginScriptForbiddenScope()
15 { 14 {
16 ASSERT(isMainThread()); 15 ASSERT(isMainThread());
17 ++s_pluginScriptForbiddenCount; 16 ++s_pluginScriptForbiddenCount;
18 } 17 }
19 18
20 PluginScriptForbiddenScope::~PluginScriptForbiddenScope() 19 PluginScriptForbiddenScope::~PluginScriptForbiddenScope()
21 { 20 {
22 ASSERT(isMainThread()); 21 ASSERT(isMainThread());
23 ASSERT(s_pluginScriptForbiddenCount); 22 ASSERT(s_pluginScriptForbiddenCount);
24 --s_pluginScriptForbiddenCount; 23 --s_pluginScriptForbiddenCount;
25 } 24 }
26 25
27 bool PluginScriptForbiddenScope::isForbidden() 26 bool PluginScriptForbiddenScope::isForbidden()
28 { 27 {
29 ASSERT(isMainThread()); 28 ASSERT(isMainThread());
30 return s_pluginScriptForbiddenCount > 0; 29 return s_pluginScriptForbiddenCount > 0;
31 } 30 }
32 31
33 } // namespace blink 32 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698