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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 PassRefPtrWillBeRawPtr<MessageEvent> createConnectEvent(PassRefPtrWillBeRawPtr<M
essagePort> prpPort) | 45 PassRefPtrWillBeRawPtr<MessageEvent> createConnectEvent(PassRefPtrWillBeRawPtr<M
essagePort> prpPort) |
46 { | 46 { |
47 RefPtrWillBeRawPtr<MessagePort> port = prpPort; | 47 RefPtrWillBeRawPtr<MessagePort> port = prpPort; |
48 RefPtrWillBeRawPtr<MessageEvent> event = MessageEvent::create(adoptPtrWillBe
Noop(new MessagePortArray(1, port)), String(), String(), port); | 48 RefPtrWillBeRawPtr<MessageEvent> event = MessageEvent::create(adoptPtrWillBe
Noop(new MessagePortArray(1, port)), String(), String(), port); |
49 event->initEvent(EventTypeNames::connect, false, false); | 49 event->initEvent(EventTypeNames::connect, false, false); |
50 return event.release(); | 50 return event.release(); |
51 } | 51 } |
52 | 52 |
53 // static | 53 // static |
54 PassRefPtrWillBeRawPtr<SharedWorkerGlobalScope> SharedWorkerGlobalScope::create(
const String& name, SharedWorkerThread* thread, PassOwnPtrWillBeRawPtr<WorkerThr
eadStartupData> startupData) | 54 PassRefPtrWillBeRawPtr<SharedWorkerGlobalScope> SharedWorkerGlobalScope::create(
const String& name, SharedWorkerThread* thread, PassOwnPtr<WorkerThreadStartupDa
ta> startupData) |
55 { | 55 { |
| 56 // Note: startupData is finalized on return. After the relevant parts has be
en |
| 57 // passed along to the created 'context'. |
56 RefPtrWillBeRawPtr<SharedWorkerGlobalScope> context = adoptRefWillBeNoop(new
SharedWorkerGlobalScope(name, startupData->m_scriptURL, startupData->m_userAgen
t, thread, startupData->m_starterOrigin, startupData->m_workerClients.release())
); | 58 RefPtrWillBeRawPtr<SharedWorkerGlobalScope> context = adoptRefWillBeNoop(new
SharedWorkerGlobalScope(name, startupData->m_scriptURL, startupData->m_userAgen
t, thread, startupData->m_starterOrigin, startupData->m_workerClients.release())
); |
57 context->applyContentSecurityPolicyFromString(startupData->m_contentSecurity
Policy, startupData->m_contentSecurityPolicyType); | 59 context->applyContentSecurityPolicyFromString(startupData->m_contentSecurity
Policy, startupData->m_contentSecurityPolicyType); |
58 return context.release(); | 60 return context.release(); |
59 } | 61 } |
60 | 62 |
61 SharedWorkerGlobalScope::SharedWorkerGlobalScope(const String& name, const KURL&
url, const String& userAgent, SharedWorkerThread* thread, const SecurityOrigin*
starterOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients) | 63 SharedWorkerGlobalScope::SharedWorkerGlobalScope(const String& name, const KURL&
url, const String& userAgent, SharedWorkerThread* thread, const SecurityOrigin*
starterOrigin, PassOwnPtrWillBeRawPtr<WorkerClients> workerClients) |
62 : WorkerGlobalScope(url, userAgent, thread, monotonicallyIncreasingTime(), s
tarterOrigin, workerClients) | 64 : WorkerGlobalScope(url, userAgent, thread, monotonicallyIncreasingTime(), s
tarterOrigin, workerClients) |
63 , m_name(name) | 65 , m_name(name) |
64 { | 66 { |
65 } | 67 } |
(...skipping 20 matching lines...) Expand all Loading... |
86 consoleMessage->setCallStack(callStack); | 88 consoleMessage->setCallStack(callStack); |
87 addMessageToWorkerConsole(consoleMessage.release()); | 89 addMessageToWorkerConsole(consoleMessage.release()); |
88 } | 90 } |
89 | 91 |
90 DEFINE_TRACE(SharedWorkerGlobalScope) | 92 DEFINE_TRACE(SharedWorkerGlobalScope) |
91 { | 93 { |
92 WorkerGlobalScope::trace(visitor); | 94 WorkerGlobalScope::trace(visitor); |
93 } | 95 } |
94 | 96 |
95 } // namespace blink | 97 } // namespace blink |
OLD | NEW |