| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // or by Worker thread termination code to prevent future entry into JS. | 84 // or by Worker thread termination code to prevent future entry into JS. |
| 85 void forbidExecution(); | 85 void forbidExecution(); |
| 86 bool isExecutionForbidden() const; | 86 bool isExecutionForbidden() const; |
| 87 | 87 |
| 88 void disableEval(const String&); | 88 void disableEval(const String&); |
| 89 | 89 |
| 90 // Evaluate a script file in the current execution environment. | 90 // Evaluate a script file in the current execution environment. |
| 91 ScriptValue evaluate(const String& script, const String& fileName, const
TextPosition& scriptStartPosition, WorkerGlobalScopeExecutionState*); | 91 ScriptValue evaluate(const String& script, const String& fileName, const
TextPosition& scriptStartPosition, WorkerGlobalScopeExecutionState*); |
| 92 | 92 |
| 93 v8::Isolate* isolate() const { return m_isolate; } | 93 v8::Isolate* isolate() const { return m_isolate; } |
| 94 DOMWrapperWorld& world() const { return *m_world; } | 94 DOMWrapperWorld* world() const { return m_world.get(); } |
| 95 v8::Local<v8::Context> context() { return m_perContextData ? m_perContex
tData->context() : v8::Local<v8::Context>(); } | 95 v8::Local<v8::Context> context() { return m_perContextData ? m_perContex
tData->context() : v8::Local<v8::Context>(); } |
| 96 | 96 |
| 97 // Send a notification about current thread is going to be idle. | 97 // Send a notification about current thread is going to be idle. |
| 98 // Returns true if the embedder should stop calling idleNotification | 98 // Returns true if the embedder should stop calling idleNotification |
| 99 // until real work has been done. | 99 // until real work has been done. |
| 100 bool idleNotification() { return v8::V8::IdleNotification(); } | 100 bool idleNotification() { return v8::V8::IdleNotification(); } |
| 101 | 101 |
| 102 private: | 102 private: |
| 103 bool initializeContextIfNeeded(); | 103 bool initializeContextIfNeeded(); |
| 104 void disposeContext(); | 104 void disposeContext(); |
| 105 | 105 |
| 106 v8::Isolate* m_isolate; | 106 v8::Isolate* m_isolate; |
| 107 WorkerGlobalScope& m_workerGlobalScope; | 107 WorkerGlobalScope& m_workerGlobalScope; |
| 108 OwnPtr<V8PerContextData> m_perContextData; | 108 OwnPtr<V8PerContextData> m_perContextData; |
| 109 String m_disableEvalPending; | 109 String m_disableEvalPending; |
| 110 RefPtr<DOMWrapperWorld> m_world; | 110 RefPtr<DOMWrapperWorld> m_world; |
| 111 bool m_executionForbidden; | 111 bool m_executionForbidden; |
| 112 bool m_executionScheduledToTerminate; | 112 bool m_executionScheduledToTerminate; |
| 113 mutable Mutex m_scheduledTerminationMutex; | 113 mutable Mutex m_scheduledTerminationMutex; |
| 114 RefPtr<ErrorEvent> m_errorEventFromImportedScript; | 114 RefPtr<ErrorEvent> m_errorEventFromImportedScript; |
| 115 OwnPtr<V8IsolateInterruptor> m_interruptor; | 115 OwnPtr<V8IsolateInterruptor> m_interruptor; |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 } // namespace WebCore | 118 } // namespace WebCore |
| 119 | 119 |
| 120 #endif // WorkerScriptController_h | 120 #endif // WorkerScriptController_h |
| OLD | NEW |