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

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

Issue 916273002: Make DocumentLoader::timing return a reference (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase against ToT Created 5 years, 10 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 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 // FIXME: This need to be revisited when we support nested worker one day 115 // FIXME: This need to be revisited when we support nested worker one day
116 ASSERT(m_executionContext->isDocument()); 116 ASSERT(m_executionContext->isDocument());
117 if (m_askedToTerminate) { 117 if (m_askedToTerminate) {
118 // Worker.terminate() could be called from JS before the thread was crea ted. 118 // Worker.terminate() could be called from JS before the thread was crea ted.
119 return; 119 return;
120 } 120 }
121 Document* document = toDocument(m_executionContext.get()); 121 Document* document = toDocument(m_executionContext.get());
122 SecurityOrigin* starterOrigin = document->securityOrigin(); 122 SecurityOrigin* starterOrigin = document->securityOrigin();
123 123
124 OwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData = WorkerThreadStartu pData::create(scriptURL, userAgent, sourceCode, nullptr, startMode, document->co ntentSecurityPolicy()->deprecatedHeader(), document->contentSecurityPolicy()->de precatedHeaderType(), starterOrigin, m_workerClients.release()); 124 OwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData = WorkerThreadStartu pData::create(scriptURL, userAgent, sourceCode, nullptr, startMode, document->co ntentSecurityPolicy()->deprecatedHeader(), document->contentSecurityPolicy()->de precatedHeaderType(), starterOrigin, m_workerClients.release());
125 double originTime = document->loader() ? document->loader()->timing()->refer enceMonotonicTime() : monotonicallyIncreasingTime(); 125 double originTime = document->loader() ? document->loader()->timing().refere nceMonotonicTime() : monotonicallyIncreasingTime();
126 126
127 m_loaderProxy = WorkerLoaderProxy::create(this); 127 m_loaderProxy = WorkerLoaderProxy::create(this);
128 RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(m_loade rProxy, *m_workerObjectProxy.get(), originTime, startupData.release()); 128 RefPtr<DedicatedWorkerThread> thread = DedicatedWorkerThread::create(m_loade rProxy, *m_workerObjectProxy.get(), originTime, startupData.release());
129 thread->start(); 129 thread->start();
130 workerThreadCreated(thread); 130 workerThreadCreated(thread);
131 m_workerInspectorProxy->workerThreadCreated(m_executionContext.get(), m_work erThread.get(), scriptURL); 131 m_workerInspectorProxy->workerThreadCreated(m_executionContext.get(), m_work erThread.get(), scriptURL);
132 } 132 }
133 133
134 void WorkerMessagingProxy::postMessageToWorkerObject(PassRefPtr<SerializedScript Value> message, PassOwnPtr<MessagePortChannelArray> channels) 134 void WorkerMessagingProxy::postMessageToWorkerObject(PassRefPtr<SerializedScript Value> message, PassOwnPtr<MessagePortChannelArray> channels)
135 { 135 {
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 299
300 // FIXME: This need to be revisited when we support nested worker one day 300 // FIXME: This need to be revisited when we support nested worker one day
301 ASSERT(m_executionContext->isDocument()); 301 ASSERT(m_executionContext->isDocument());
302 Document* document = toDocument(m_executionContext.get()); 302 Document* document = toDocument(m_executionContext.get());
303 LocalFrame* frame = document->frame(); 303 LocalFrame* frame = document->frame();
304 if (frame) 304 if (frame)
305 frame->console().adoptWorkerMessagesAfterTermination(this); 305 frame->console().adoptWorkerMessagesAfterTermination(this);
306 } 306 }
307 307
308 } // namespace blink 308 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/timing/PerformanceTiming.cpp ('k') | Source/modules/performance/SharedWorkerPerformance.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698