| OLD | NEW |
| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 #include "platform/weborigin/KURL.h" | 65 #include "platform/weborigin/KURL.h" |
| 66 #include "platform/weborigin/SecurityOrigin.h" | 66 #include "platform/weborigin/SecurityOrigin.h" |
| 67 #include "public/platform/WebURLRequest.h" | 67 #include "public/platform/WebURLRequest.h" |
| 68 | 68 |
| 69 namespace blink { | 69 namespace blink { |
| 70 | 70 |
| 71 WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, W
orkerThread* thread, double timeOrigin, const SecurityOrigin* starterOrigin, Pas
sOwnPtrWillBeRawPtr<WorkerClients> workerClients) | 71 WorkerGlobalScope::WorkerGlobalScope(const KURL& url, const String& userAgent, W
orkerThread* thread, double timeOrigin, const SecurityOrigin* starterOrigin, Pas
sOwnPtrWillBeRawPtr<WorkerClients> workerClients) |
| 72 : m_url(url) | 72 : m_url(url) |
| 73 , m_userAgent(userAgent) | 73 , m_userAgent(userAgent) |
| 74 , m_v8CacheOptions(V8CacheOptionsDefault) | 74 , m_v8CacheOptions(V8CacheOptionsDefault) |
| 75 , m_script(adoptPtr(new WorkerScriptController(*this, thread->isolate()))) | 75 , m_script(WorkerScriptController::create(this, thread->isolate())) |
| 76 , m_thread(thread) | 76 , m_thread(thread) |
| 77 , m_workerInspectorController(adoptRefWillBeNoop(new WorkerInspectorControll
er(this))) | 77 , m_workerInspectorController(adoptRefWillBeNoop(new WorkerInspectorControll
er(this))) |
| 78 , m_closing(false) | 78 , m_closing(false) |
| 79 , m_eventQueue(WorkerEventQueue::create(this)) | 79 , m_eventQueue(WorkerEventQueue::create(this)) |
| 80 , m_workerClients(workerClients) | 80 , m_workerClients(workerClients) |
| 81 , m_timeOrigin(timeOrigin) | 81 , m_timeOrigin(timeOrigin) |
| 82 , m_messageStorage(ConsoleMessageStorage::create()) | 82 , m_messageStorage(ConsoleMessageStorage::create()) |
| 83 , m_workerExceptionUniqueIdentifier(0) | 83 , m_workerExceptionUniqueIdentifier(0) |
| 84 { | 84 { |
| 85 setSecurityOrigin(SecurityOrigin::create(url)); | 85 setSecurityOrigin(SecurityOrigin::create(url)); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 if (!m_navigator) | 179 if (!m_navigator) |
| 180 m_navigator = WorkerNavigator::create(m_userAgent); | 180 m_navigator = WorkerNavigator::create(m_userAgent); |
| 181 return m_navigator.get(); | 181 return m_navigator.get(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 void WorkerGlobalScope::postTask(const WebTraceLocation& location, PassOwnPtr<Ex
ecutionContextTask> task) | 184 void WorkerGlobalScope::postTask(const WebTraceLocation& location, PassOwnPtr<Ex
ecutionContextTask> task) |
| 185 { | 185 { |
| 186 thread()->postTask(location, task); | 186 thread()->postTask(location, task); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void WorkerGlobalScope::clearScript() |
| 190 { |
| 191 ASSERT(m_script); |
| 192 m_script->dispose(); |
| 193 m_script.clear(); |
| 194 } |
| 195 |
| 189 void WorkerGlobalScope::clearInspector() | 196 void WorkerGlobalScope::clearInspector() |
| 190 { | 197 { |
| 191 ASSERT(m_workerInspectorController); | 198 ASSERT(m_workerInspectorController); |
| 192 thread()->setWorkerInspectorController(nullptr); | 199 thread()->setWorkerInspectorController(nullptr); |
| 193 m_workerInspectorController->dispose(); | 200 m_workerInspectorController->dispose(); |
| 194 m_workerInspectorController.clear(); | 201 m_workerInspectorController.clear(); |
| 195 } | 202 } |
| 196 | 203 |
| 197 void WorkerGlobalScope::dispose() | 204 void WorkerGlobalScope::dispose() |
| 198 { | 205 { |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 RELEASE_ASSERT_NOT_REACHED(); // same as wrap method | 390 RELEASE_ASSERT_NOT_REACHED(); // same as wrap method |
| 384 return v8::Local<v8::Object>(); | 391 return v8::Local<v8::Object>(); |
| 385 } | 392 } |
| 386 | 393 |
| 387 DEFINE_TRACE(WorkerGlobalScope) | 394 DEFINE_TRACE(WorkerGlobalScope) |
| 388 { | 395 { |
| 389 #if ENABLE(OILPAN) | 396 #if ENABLE(OILPAN) |
| 390 visitor->trace(m_console); | 397 visitor->trace(m_console); |
| 391 visitor->trace(m_location); | 398 visitor->trace(m_location); |
| 392 visitor->trace(m_navigator); | 399 visitor->trace(m_navigator); |
| 400 visitor->trace(m_script); |
| 393 visitor->trace(m_workerInspectorController); | 401 visitor->trace(m_workerInspectorController); |
| 394 visitor->trace(m_eventQueue); | 402 visitor->trace(m_eventQueue); |
| 395 visitor->trace(m_workerClients); | 403 visitor->trace(m_workerClients); |
| 396 visitor->trace(m_timers); | 404 visitor->trace(m_timers); |
| 397 visitor->trace(m_messageStorage); | 405 visitor->trace(m_messageStorage); |
| 398 visitor->trace(m_pendingMessages); | 406 visitor->trace(m_pendingMessages); |
| 399 HeapSupplementable<WorkerGlobalScope>::trace(visitor); | 407 HeapSupplementable<WorkerGlobalScope>::trace(visitor); |
| 400 #endif | 408 #endif |
| 401 ExecutionContext::trace(visitor); | 409 ExecutionContext::trace(visitor); |
| 402 EventTargetWithInlineData::trace(visitor); | 410 EventTargetWithInlineData::trace(visitor); |
| 403 SecurityContext::trace(visitor); | 411 SecurityContext::trace(visitor); |
| 404 } | 412 } |
| 405 | 413 |
| 406 } // namespace blink | 414 } // namespace blink |
| OLD | NEW |