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

Unified Diff: Source/core/workers/WorkerMessagingProxy.cpp

Issue 644663004: Use C++11 features in core/workers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/workers/WorkerMessagingProxy.h ('k') | Source/core/workers/WorkerScriptLoader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerMessagingProxy.cpp
diff --git a/Source/core/workers/WorkerMessagingProxy.cpp b/Source/core/workers/WorkerMessagingProxy.cpp
index e977fe8cb94b3a6068d7728d74a6b8455844e5f4..6d4598bd32d1ad6af536ddd5eaf5c5ed07f28877 100644
--- a/Source/core/workers/WorkerMessagingProxy.cpp
+++ b/Source/core/workers/WorkerMessagingProxy.cpp
@@ -172,7 +172,7 @@ void WorkerMessagingProxy::reportException(const String& errorMessage, int lineN
// We don't bother checking the askedToTerminate() flag here, because exceptions should *always* be reported even if the thread is terminated.
// This is intentionally different than the behavior in MessageWorkerTask, because terminated workers no longer deliver messages (section 4.6 of the WebWorker spec), but they do report exceptions.
- RefPtrWillBeRawPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, sourceURL, lineNumber, columnNumber, 0);
+ RefPtrWillBeRawPtr<ErrorEvent> event = ErrorEvent::create(errorMessage, sourceURL, lineNumber, columnNumber, nullptr);
bool errorHandled = !m_workerObject->dispatchEvent(event);
if (!errorHandled)
m_executionContext->reportException(event, 0, nullptr, NotSharableCrossOrigin);
@@ -199,19 +199,18 @@ void WorkerMessagingProxy::workerThreadCreated(PassRefPtr<DedicatedWorkerThread>
ASSERT(!m_askedToTerminate);
m_workerThread = workerThread;
- unsigned taskCount = m_queuedEarlyTasks.size();
ASSERT(!m_unconfirmedMessageCount);
- m_unconfirmedMessageCount = taskCount;
+ m_unconfirmedMessageCount = m_queuedEarlyTasks.size();
m_workerThreadHadPendingActivity = true; // Worker initialization means a pending activity.
- for (unsigned i = 0; i < taskCount; ++i)
- m_workerThread->postTask(m_queuedEarlyTasks[i].release());
+ for (auto& earlyTasks : m_queuedEarlyTasks)
+ m_workerThread->postTask(earlyTasks.release());
m_queuedEarlyTasks.clear();
}
void WorkerMessagingProxy::workerObjectDestroyed()
{
- m_workerObject = 0;
+ m_workerObject = nullptr;
m_executionContext->postTask(createCrossThreadTask(&workerObjectDestroyedInternal, AllowCrossThreadAccess(this)));
}
« no previous file with comments | « Source/core/workers/WorkerMessagingProxy.h ('k') | Source/core/workers/WorkerScriptLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698