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

Side by Side Diff: Source/bindings/v8/V8Initializer.cpp

Issue 17648006: Rename WorkerContext to WorkerGlobalScope (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 6 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
« no previous file with comments | « Source/bindings/v8/V8EventListenerList.cpp ('k') | Source/bindings/v8/V8Utilities.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/bindings/v8/V8EventListenerList.cpp ('k') | Source/bindings/v8/V8Utilities.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698