OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 v8::Local<v8::Context> context() { return m_scriptState ? m_scriptState->con
text() : v8::Local<v8::Context>(); } | 89 v8::Local<v8::Context> context() { return m_scriptState ? m_scriptState->con
text() : v8::Local<v8::Context>(); } |
90 | 90 |
91 RejectedPromises* rejectedPromises() const { return m_rejectedPromises.get()
; } | 91 RejectedPromises* rejectedPromises() const { return m_rejectedPromises.get()
; } |
92 | 92 |
93 DECLARE_TRACE(); | 93 DECLARE_TRACE(); |
94 | 94 |
95 bool isContextInitialized() const { return m_scriptState && !!m_scriptState-
>perContextData(); } | 95 bool isContextInitialized() const { return m_scriptState && !!m_scriptState-
>perContextData(); } |
96 | 96 |
97 private: | 97 private: |
98 WorkerScriptController(WorkerGlobalScope*, v8::Isolate*); | 98 WorkerScriptController(WorkerGlobalScope*, v8::Isolate*); |
99 class WorkerGlobalScopeExecutionState; | 99 class ExecutionState; |
100 | 100 |
101 v8::Isolate* isolate() const; | 101 v8::Isolate* isolate() const; |
102 | 102 |
103 // Evaluate a script file in the current execution environment. | 103 // Evaluate a script file in the current execution environment. |
104 ScriptValue evaluate(const String& script, const String& fileName, const Tex
tPosition& scriptStartPosition, CachedMetadataHandler*, V8CacheOptions); | 104 ScriptValue evaluate(const String& script, const String& fileName, const Tex
tPosition& scriptStartPosition, CachedMetadataHandler*, V8CacheOptions); |
105 | 105 |
106 RawPtrWillBeMember<WorkerGlobalScope> m_workerGlobalScope; | 106 RawPtrWillBeMember<WorkerGlobalScope> m_workerGlobalScope; |
107 RefPtr<ScriptState> m_scriptState; | 107 RefPtr<ScriptState> m_scriptState; |
108 RefPtr<DOMWrapperWorld> m_world; | 108 RefPtr<DOMWrapperWorld> m_world; |
109 String m_disableEvalPending; | 109 String m_disableEvalPending; |
110 bool m_executionForbidden; | 110 bool m_executionForbidden; |
111 bool m_executionScheduledToTerminate; | 111 bool m_executionScheduledToTerminate; |
112 mutable Mutex m_scheduledTerminationMutex; | 112 mutable Mutex m_scheduledTerminationMutex; |
113 | 113 |
114 RefPtrWillBeMember<RejectedPromises> m_rejectedPromises; | 114 RefPtrWillBeMember<RejectedPromises> m_rejectedPromises; |
115 | 115 |
116 // |m_globalScopeExecutionState| refers to a stack object | 116 // |m_executionState| refers to a stack object that evaluate() allocates; |
117 // that evaluate() allocates; evaluate() ensuring that the | 117 // evaluate() ensuring that the pointer reference to it is removed upon |
118 // pointer reference to it is removed upon returning. Hence | 118 // returning. Hence kept as a bare pointer here, and not a Persistent with |
119 // kept as a bare pointer here, and not a Persistent with | |
120 // Oilpan enabled; stack scanning will visit the object and | 119 // Oilpan enabled; stack scanning will visit the object and |
121 // trace its on-heap fields. | 120 // trace its on-heap fields. |
122 GC_PLUGIN_IGNORE("394615") | 121 GC_PLUGIN_IGNORE("394615") |
123 WorkerGlobalScopeExecutionState* m_globalScopeExecutionState; | 122 ExecutionState* m_executionState; |
124 }; | 123 }; |
125 | 124 |
126 } // namespace blink | 125 } // namespace blink |
127 | 126 |
128 #endif // WorkerScriptController_h | 127 #endif // WorkerScriptController_h |
OLD | NEW |