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

Side by Side Diff: WebCore/bindings/js/WorkerScriptController.cpp

Issue 9572031: Don't be so CRASH happy in the bindings layer. (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/Source/
Patch Set: Created 8 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2011 Google Inc. All Rights Reserved. 3 * Copyright (C) 2011 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 155 }
156 } 156 }
157 157
158 void WorkerScriptController::setException(ScriptValue exception) 158 void WorkerScriptController::setException(ScriptValue exception)
159 { 159 {
160 throwError(m_workerContextWrapper->globalExec(), exception.jsValue()); 160 throwError(m_workerContextWrapper->globalExec(), exception.jsValue());
161 } 161 }
162 162
163 void WorkerScriptController::scheduleExecutionTermination() 163 void WorkerScriptController::scheduleExecutionTermination()
164 { 164 {
165 MutexLocker locker(m_scheduledTerminationMutex);
165 m_globalData->terminator.terminateSoon(); 166 m_globalData->terminator.terminateSoon();
166 } 167 }
167 168
169 bool WorkerScriptController::isExecutionTerminating() const
170 {
171 MutexLocker locker(m_scheduledTerminationMutex);
172 return m_globalData->terminator.shouldTerminate();
173 }
174
168 void WorkerScriptController::forbidExecution() 175 void WorkerScriptController::forbidExecution()
169 { 176 {
170 ASSERT(m_workerContext->isContextThread()); 177 ASSERT(m_workerContext->isContextThread());
171 m_executionForbidden = true; 178 m_executionForbidden = true;
172 } 179 }
173 180
174 bool WorkerScriptController::isExecutionForbidden() const 181 bool WorkerScriptController::isExecutionForbidden() const
175 { 182 {
176 ASSERT(m_workerContext->isContextThread()); 183 ASSERT(m_workerContext->isContextThread());
177 return m_executionForbidden; 184 return m_executionForbidden;
178 } 185 }
179 186
180 void WorkerScriptController::disableEval() 187 void WorkerScriptController::disableEval()
181 { 188 {
182 initScriptIfNeeded(); 189 initScriptIfNeeded();
183 JSLock lock(SilenceAssertionsOnly); 190 JSLock lock(SilenceAssertionsOnly);
184 191
185 m_workerContextWrapper->setEvalEnabled(false); 192 m_workerContextWrapper->setEvalEnabled(false);
186 } 193 }
187 194
188 } // namespace WebCore 195 } // namespace WebCore
189 196
190 #endif // ENABLE(WORKERS) 197 #endif // ENABLE(WORKERS)
OLDNEW
« no previous file with comments | « WebCore/bindings/js/WorkerScriptController.h ('k') | WebCore/bindings/scripts/CodeGeneratorV8.pm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698