| OLD | NEW |
| 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 #include "wtf/MainThread.h" | |
| 9 | 8 |
| 10 namespace blink { | 9 namespace blink { |
| 11 | 10 |
| 12 static unsigned s_scriptForbiddenCount = 0; | 11 static unsigned s_scriptForbiddenCount = 0; |
| 13 | 12 |
| 14 ScriptForbiddenScope::ScriptForbiddenScope() | 13 ScriptForbiddenScope::ScriptForbiddenScope() |
| 15 { | 14 { |
| 16 enter(); | 15 enter(); |
| 17 } | 16 } |
| 18 | 17 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 if (isMainThread()) | 54 if (isMainThread()) |
| 56 ScriptForbiddenScope::enter(); | 55 ScriptForbiddenScope::enter(); |
| 57 } | 56 } |
| 58 | 57 |
| 59 ScriptForbiddenIfMainThreadScope::~ScriptForbiddenIfMainThreadScope() | 58 ScriptForbiddenIfMainThreadScope::~ScriptForbiddenIfMainThreadScope() |
| 60 { | 59 { |
| 61 if (isMainThread()) | 60 if (isMainThread()) |
| 62 ScriptForbiddenScope::exit(); | 61 ScriptForbiddenScope::exit(); |
| 63 } | 62 } |
| 64 } // namespace blink | 63 } // namespace blink |
| OLD | NEW |