OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 static void reportFatalErrorInWorker(const char* location, const char* message) | 133 static void reportFatalErrorInWorker(const char* location, const char* message) |
134 { | 134 { |
135 // FIXME: We temporarily deal with V8 internal error situations such as out-
of-memory by crashing the worker. | 135 // FIXME: We temporarily deal with V8 internal error situations such as out-
of-memory by crashing the worker. |
136 CRASH(); | 136 CRASH(); |
137 } | 137 } |
138 | 138 |
139 static void messageHandlerInWorker(v8::Handle<v8::Message> message, v8::Handle<v
8::Value> data) | 139 static void messageHandlerInWorker(v8::Handle<v8::Message> message, v8::Handle<v
8::Value> data) |
140 { | 140 { |
141 static bool isReportingException = false; | 141 static bool isReportingException = false; |
142 // Exceptions that occur in error handler should be ignored since in that ca
se | 142 // Exceptions that occur in error handler should be ignored since in that ca
se |
143 // WorkerContext::reportException will send the exception to the worker obje
ct. | 143 // WorkerGlobalScope::reportException will send the exception to the worker
object. |
144 if (isReportingException) | 144 if (isReportingException) |
145 return; | 145 return; |
146 isReportingException = true; | 146 isReportingException = true; |
147 | 147 |
148 // During the frame teardown, there may not be a valid context. | 148 // During the frame teardown, there may not be a valid context. |
149 if (ScriptExecutionContext* context = getScriptExecutionContext()) { | 149 if (ScriptExecutionContext* context = getScriptExecutionContext()) { |
150 String errorMessage = toWebCoreString(message->Get()); | 150 String errorMessage = toWebCoreString(message->Get()); |
151 int lineNumber = message->GetLineNumber(); | 151 int lineNumber = message->GetLineNumber(); |
152 String sourceURL = toWebCoreString(message->GetScriptResourceName()); | 152 String sourceURL = toWebCoreString(message->GetScriptResourceName()); |
153 context->reportException(errorMessage, lineNumber, sourceURL, 0); | 153 context->reportException(errorMessage, lineNumber, sourceURL, 0); |
(...skipping 13 matching lines...) Expand all Loading... |
167 | 167 |
168 v8::ResourceConstraints resourceConstraints; | 168 v8::ResourceConstraints resourceConstraints; |
169 uint32_t here; | 169 uint32_t here; |
170 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); | 170 resourceConstraints.set_stack_limit(&here - kWorkerMaxStackSize / sizeof(uin
t32_t*)); |
171 v8::SetResourceConstraints(&resourceConstraints); | 171 v8::SetResourceConstraints(&resourceConstraints); |
172 | 172 |
173 V8PerIsolateData::ensureInitialized(isolate); | 173 V8PerIsolateData::ensureInitialized(isolate); |
174 } | 174 } |
175 | 175 |
176 } // namespace WebCore | 176 } // namespace WebCore |
OLD | NEW |