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

Side by Side Diff: Source/core/workers/SharedWorkerGlobalScope.cpp

Issue 1115923002: workers: Rename WorkerThread to WorkerScript. Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 5 years, 7 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
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 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
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, PassOwnPtr<WorkerThreadStartupDa ta> startupData) 54 PassRefPtrWillBeRawPtr<SharedWorkerGlobalScope> SharedWorkerGlobalScope::create( const String& name, SharedWorkerThread* thread, PassOwnPtr<WorkerScriptStartupDa ta> startupData)
55 { 55 {
56 // Note: startupData is finalized on return. After the relevant parts has be en 56 // Note: startupData is finalized on return. After the relevant parts has be en
57 // passed along to the created 'context'. 57 // passed along to the created 'context'.
58 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()) );
59 context->applyContentSecurityPolicyFromString(startupData->m_contentSecurity Policy, startupData->m_contentSecurityPolicyType); 59 context->applyContentSecurityPolicyFromString(startupData->m_contentSecurity Policy, startupData->m_contentSecurityPolicyType);
60 return context.release(); 60 return context.release();
61 } 61 }
62 62
63 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)
64 : WorkerGlobalScope(url, userAgent, thread, monotonicallyIncreasingTime(), s tarterOrigin, workerClients) 64 : WorkerGlobalScope(url, userAgent, thread, monotonicallyIncreasingTime(), s tarterOrigin, workerClients)
65 , m_name(name) 65 , m_name(name)
66 { 66 {
67 } 67 }
68 68
69 SharedWorkerGlobalScope::~SharedWorkerGlobalScope() 69 SharedWorkerGlobalScope::~SharedWorkerGlobalScope()
70 { 70 {
71 } 71 }
72 72
73 const AtomicString& SharedWorkerGlobalScope::interfaceName() const 73 const AtomicString& SharedWorkerGlobalScope::interfaceName() const
74 { 74 {
75 return EventTargetNames::SharedWorkerGlobalScope; 75 return EventTargetNames::SharedWorkerGlobalScope;
76 } 76 }
77 77
78 SharedWorkerThread* SharedWorkerGlobalScope::thread() 78 SharedWorkerThread* SharedWorkerGlobalScope::thread()
79 { 79 {
80 return static_cast<SharedWorkerThread*>(Base::thread()); 80 return static_cast<SharedWorkerThread*>(Base::script());
81 } 81 }
82 82
83 void SharedWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, int scriptId, const String& sourceURL, int lineNumber, int columnNumber, PassRef PtrWillBeRawPtr<ScriptCallStack> callStack) 83 void SharedWorkerGlobalScope::logExceptionToConsole(const String& errorMessage, int scriptId, const String& sourceURL, int lineNumber, int columnNumber, PassRef PtrWillBeRawPtr<ScriptCallStack> callStack)
84 { 84 {
85 WorkerGlobalScope::logExceptionToConsole(errorMessage, scriptId, sourceURL, lineNumber, columnNumber, callStack); 85 WorkerGlobalScope::logExceptionToConsole(errorMessage, scriptId, sourceURL, lineNumber, columnNumber, callStack);
86 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(J SMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber); 86 RefPtrWillBeRawPtr<ConsoleMessage> consoleMessage = ConsoleMessage::create(J SMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber);
87 consoleMessage->setScriptId(scriptId); 87 consoleMessage->setScriptId(scriptId);
88 consoleMessage->setCallStack(callStack); 88 consoleMessage->setCallStack(callStack);
89 addMessageToWorkerConsole(consoleMessage.release()); 89 addMessageToWorkerConsole(consoleMessage.release());
90 } 90 }
91 91
92 DEFINE_TRACE(SharedWorkerGlobalScope) 92 DEFINE_TRACE(SharedWorkerGlobalScope)
93 { 93 {
94 WorkerGlobalScope::trace(visitor); 94 WorkerGlobalScope::trace(visitor);
95 } 95 }
96 96
97 } // namespace blink 97 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698