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

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

Issue 2151933003: Change WTF::TemporaryChange to be an alias for AutoReset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TemporaryChange -> AutoReset Created 4 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ScriptForbiddenScope.h" 5 #include "platform/ScriptForbiddenScope.h"
6 6
7 #include "wtf/Assertions.h" 7 #include "wtf/Assertions.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 bool ScriptForbiddenScope::isScriptForbidden() 36 bool ScriptForbiddenScope::isScriptForbidden()
37 { 37 {
38 return isMainThread() && s_scriptForbiddenCount; 38 return isMainThread() && s_scriptForbiddenCount;
39 } 39 }
40 40
41 ScriptForbiddenScope::AllowUserAgentScript::AllowUserAgentScript() 41 ScriptForbiddenScope::AllowUserAgentScript::AllowUserAgentScript()
42 { 42 {
43 if (isMainThread()) 43 if (isMainThread())
44 m_change.emplace(s_scriptForbiddenCount, 0); 44 m_change.emplace(&s_scriptForbiddenCount, 0);
45 } 45 }
46 46
47 ScriptForbiddenScope::AllowUserAgentScript::~AllowUserAgentScript() 47 ScriptForbiddenScope::AllowUserAgentScript::~AllowUserAgentScript()
48 { 48 {
49 ASSERT(!isMainThread() || !s_scriptForbiddenCount); 49 ASSERT(!isMainThread() || !s_scriptForbiddenCount);
50 } 50 }
51 51
52 ScriptForbiddenIfMainThreadScope::ScriptForbiddenIfMainThreadScope() 52 ScriptForbiddenIfMainThreadScope::ScriptForbiddenIfMainThreadScope()
53 { 53 {
54 if (isMainThread()) 54 if (isMainThread())
55 ScriptForbiddenScope::enter(); 55 ScriptForbiddenScope::enter();
56 } 56 }
57 57
58 ScriptForbiddenIfMainThreadScope::~ScriptForbiddenIfMainThreadScope() 58 ScriptForbiddenIfMainThreadScope::~ScriptForbiddenIfMainThreadScope()
59 { 59 {
60 if (isMainThread()) 60 if (isMainThread())
61 ScriptForbiddenScope::exit(); 61 ScriptForbiddenScope::exit();
62 } 62 }
63 } // namespace blink 63 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/ScriptForbiddenScope.h ('k') | third_party/WebKit/Source/platform/heap/HeapPage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698