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

Side by Side Diff: third_party/WebKit/Source/core/workers/WorkerGlobalScope.cpp

Issue 2124693002: Worker: Fix broken GC logic on Dedicated Worker while DOMTimer is set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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) 2009, 2011 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009, 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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 RELEASE_NOTREACHED(); 228 RELEASE_NOTREACHED();
229 return v8::Local<v8::Object>(); 229 return v8::Local<v8::Object>();
230 } 230 }
231 231
232 v8::Local<v8::Object> WorkerGlobalScope::associateWithWrapper(v8::Isolate*, cons t WrapperTypeInfo*, v8::Local<v8::Object> wrapper) 232 v8::Local<v8::Object> WorkerGlobalScope::associateWithWrapper(v8::Isolate*, cons t WrapperTypeInfo*, v8::Local<v8::Object> wrapper)
233 { 233 {
234 RELEASE_NOTREACHED(); // same as wrap method 234 RELEASE_NOTREACHED(); // same as wrap method
235 return v8::Local<v8::Object>(); 235 return v8::Local<v8::Object>();
236 } 236 }
237 237
238 bool WorkerGlobalScope::hasPendingActivity() const
239 {
240 return m_timers.hasInstalledTimeout();
241 }
242
238 bool WorkerGlobalScope::isJSExecutionForbidden() const 243 bool WorkerGlobalScope::isJSExecutionForbidden() const
239 { 244 {
240 return m_scriptController->isExecutionForbidden(); 245 return m_scriptController->isExecutionForbidden();
241 } 246 }
242 247
243 bool WorkerGlobalScope::isContextThread() const 248 bool WorkerGlobalScope::isContextThread() const
244 { 249 {
245 return thread()->isCurrentThread(); 250 return thread()->isCurrentThread();
246 } 251 }
247 252
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 errorMessage = getSecurityOrigin()->isPotentiallyTrustworthyErrorMessage(); 285 errorMessage = getSecurityOrigin()->isPotentiallyTrustworthyErrorMessage();
281 return false; 286 return false;
282 } 287 }
283 288
284 ExecutionContext* WorkerGlobalScope::getExecutionContext() const 289 ExecutionContext* WorkerGlobalScope::getExecutionContext() const
285 { 290 {
286 return const_cast<WorkerGlobalScope*>(this); 291 return const_cast<WorkerGlobalScope*>(this);
287 } 292 }
288 293
289 WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, W orkerThread* thread, double timeOrigin, std::unique_ptr<SecurityOrigin::Privileg eData> starterOriginPrivilageData, WorkerClients* workerClients) 294 WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, W orkerThread* thread, double timeOrigin, std::unique_ptr<SecurityOrigin::Privileg eData> starterOriginPrivilageData, WorkerClients* workerClients)
290 : m_url(url) 295 : ActiveScriptWrappable(this)
296 , m_url(url)
291 , m_userAgent(userAgent) 297 , m_userAgent(userAgent)
292 , m_v8CacheOptions(V8CacheOptionsDefault) 298 , m_v8CacheOptions(V8CacheOptionsDefault)
293 , m_scriptController(WorkerOrWorkletScriptController::create(this, thread->i solate())) 299 , m_scriptController(WorkerOrWorkletScriptController::create(this, thread->i solate()))
294 , m_thread(thread) 300 , m_thread(thread)
295 , m_closing(false) 301 , m_closing(false)
296 , m_eventQueue(WorkerEventQueue::create(this)) 302 , m_eventQueue(WorkerEventQueue::create(this))
297 , m_workerClients(workerClients) 303 , m_workerClients(workerClients)
298 , m_timers(Platform::current()->currentThread()->scheduler()->timerTaskRunne r()->clone()) 304 , m_timers(Platform::current()->currentThread()->scheduler()->timerTaskRunne r()->clone())
299 , m_timeOrigin(timeOrigin) 305 , m_timeOrigin(timeOrigin)
300 , m_consoleMessageStorage(new ConsoleMessageStorage()) 306 , m_consoleMessageStorage(new ConsoleMessageStorage())
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 visitor->trace(m_consoleMessageStorage); 364 visitor->trace(m_consoleMessageStorage);
359 visitor->trace(m_eventListeners); 365 visitor->trace(m_eventListeners);
360 visitor->trace(m_pendingErrorEvents); 366 visitor->trace(m_pendingErrorEvents);
361 ExecutionContext::trace(visitor); 367 ExecutionContext::trace(visitor);
362 EventTargetWithInlineData::trace(visitor); 368 EventTargetWithInlineData::trace(visitor);
363 SecurityContext::trace(visitor); 369 SecurityContext::trace(visitor);
364 Supplementable<WorkerGlobalScope>::trace(visitor); 370 Supplementable<WorkerGlobalScope>::trace(visitor);
365 } 371 }
366 372
367 } // namespace blink 373 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698