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

Side by Side Diff: Source/bindings/core/v8/V8RecursionScope.h

Issue 648423003: Enforce ScriptForbiddenScope and make it non-fatal. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Consistify Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « Source/bindings/core/v8/NPV8Object.cpp ('k') | Source/bindings/core/v8/V8ScriptRunner.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // V8RecursionScope::MicrotaskSuppression -- this skips work that is spec'd to 55 // V8RecursionScope::MicrotaskSuppression -- this skips work that is spec'd to
56 // happen at the end of the outer-most script stack frame of calls into page scr ipt: 56 // happen at the end of the outer-most script stack frame of calls into page scr ipt:
57 // 57 //
58 // http://www.whatwg.org/specs/web-apps/current-work/#perform-a-microtask-checkp oint 58 // http://www.whatwg.org/specs/web-apps/current-work/#perform-a-microtask-checkp oint
59 class V8RecursionScope { 59 class V8RecursionScope {
60 WTF_MAKE_NONCOPYABLE(V8RecursionScope); 60 WTF_MAKE_NONCOPYABLE(V8RecursionScope);
61 public: 61 public:
62 explicit V8RecursionScope(v8::Isolate* isolate) 62 explicit V8RecursionScope(v8::Isolate* isolate)
63 : m_isolate(isolate) 63 : m_isolate(isolate)
64 { 64 {
65 RELEASE_ASSERT(!ScriptForbiddenScope::isScriptForbidden());
65 V8PerIsolateData::from(m_isolate)->incrementRecursionLevel(); 66 V8PerIsolateData::from(m_isolate)->incrementRecursionLevel();
66 RELEASE_ASSERT(!ScriptForbiddenScope::isScriptForbidden());
67 // If you want V8 to autorun microtasks, this class needs to have a 67 // If you want V8 to autorun microtasks, this class needs to have a
68 // v8::Isolate::SuppressMicrotaskExecutionScope member. 68 // v8::Isolate::SuppressMicrotaskExecutionScope member.
69 ASSERT(!isolate->WillAutorunMicrotasks()); 69 ASSERT(!isolate->WillAutorunMicrotasks());
70 } 70 }
71 71
72 ~V8RecursionScope() 72 ~V8RecursionScope()
73 { 73 {
74 if (!V8PerIsolateData::from(m_isolate)->decrementRecursionLevel()) 74 if (!V8PerIsolateData::from(m_isolate)->decrementRecursionLevel())
75 didLeaveScriptContext(); 75 didLeaveScriptContext();
76 } 76 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 private: 116 private:
117 void didLeaveScriptContext(); 117 void didLeaveScriptContext();
118 118
119 v8::Isolate* m_isolate; 119 v8::Isolate* m_isolate;
120 }; 120 };
121 121
122 } // namespace blink 122 } // namespace blink
123 123
124 #endif // V8RecursionScope_h 124 #endif // V8RecursionScope_h
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/NPV8Object.cpp ('k') | Source/bindings/core/v8/V8ScriptRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698