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

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

Issue 429453010: Drop V8RecursionScope dependency on ExecutionContext (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reorder cleanup methods per haraken Created 6 years, 3 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
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // instrumentation is needed. ScriptController allocates V8RecursionScope for yo u. 52 // instrumentation is needed. ScriptController allocates V8RecursionScope for yo u.
53 // Calls of type (2) should always stack-allocate a V8RecursionScope in the same 53 // Calls of type (2) should always stack-allocate a V8RecursionScope in the same
54 // block as the call into script. Calls of type (3) should stack allocate a 54 // block as the call into script. Calls of type (3) should stack allocate a
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 V8RecursionScope(v8::Isolate* isolate, ExecutionContext* context) 62 explicit V8RecursionScope(v8::Isolate* isolate)
63 : m_isolate(isolate) 63 : m_isolate(isolate)
64 , m_executionContext(*context)
65 { 64 {
66 V8PerIsolateData::from(m_isolate)->incrementRecursionLevel(); 65 V8PerIsolateData::from(m_isolate)->incrementRecursionLevel();
67 RELEASE_ASSERT(!ScriptForbiddenScope::isScriptForbidden()); 66 RELEASE_ASSERT(!ScriptForbiddenScope::isScriptForbidden());
68 // 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
69 // v8::Isolate::SuppressMicrotaskExecutionScope member. 68 // v8::Isolate::SuppressMicrotaskExecutionScope member.
70 ASSERT(!isolate->WillAutorunMicrotasks()); 69 ASSERT(!isolate->WillAutorunMicrotasks());
71 } 70 }
72 71
73 ~V8RecursionScope() 72 ~V8RecursionScope()
74 { 73 {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 private: 110 private:
112 #if ENABLE(ASSERT) 111 #if ENABLE(ASSERT)
113 v8::Isolate* m_isolate; 112 v8::Isolate* m_isolate;
114 #endif 113 #endif
115 }; 114 };
116 115
117 private: 116 private:
118 void didLeaveScriptContext(); 117 void didLeaveScriptContext();
119 118
120 v8::Isolate* m_isolate; 119 v8::Isolate* m_isolate;
121 ExecutionContext& m_executionContext;
122 }; 120 };
123 121
124 } // namespace blink 122 } // namespace blink
125 123
126 #endif // V8RecursionScope_h 124 #endif // V8RecursionScope_h
OLDNEW
« no previous file with comments | « Source/bindings/core/v8/V8PerIsolateData.cpp ('k') | Source/bindings/core/v8/V8RecursionScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698