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

Unified Diff: Source/core/workers/WorkerGlobalScope.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/WorkerEventQueue.cpp ('k') | Source/core/workers/WorkerInspectorProxy.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/workers/WorkerGlobalScope.cpp
diff --git a/Source/core/workers/WorkerGlobalScope.cpp b/Source/core/workers/WorkerGlobalScope.cpp
index b9d97fe844cd665052990fcc4efc74421528a5eb..acf32e4d50a0fd08e849e19755a8aace5612e4c0 100644
--- a/Source/core/workers/WorkerGlobalScope.cpp
+++ b/Source/core/workers/WorkerGlobalScope.cpp
@@ -222,12 +222,11 @@ void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState
ExecutionContext& executionContext = *this->executionContext();
- Vector<String>::const_iterator urlsEnd = urls.end();
Vector<KURL> completedURLs;
- for (Vector<String>::const_iterator it = urls.begin(); it != urlsEnd; ++it) {
- const KURL& url = executionContext.completeURL(*it);
+ for (const String& urlString : urls) {
+ const KURL& url = executionContext.completeURL(urlString);
if (!url.isValid()) {
- exceptionState.throwDOMException(SyntaxError, "The URL '" + *it + "' is invalid.");
+ exceptionState.throwDOMException(SyntaxError, "The URL '" + urlString + "' is invalid.");
return;
}
if (!contentSecurityPolicy()->allowScriptFromSource(url)) {
@@ -236,16 +235,15 @@ void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState
}
completedURLs.append(url);
}
- Vector<KURL>::const_iterator end = completedURLs.end();
- for (Vector<KURL>::const_iterator it = completedURLs.begin(); it != end; ++it) {
+ for (const KURL& completeURL : completedURLs) {
RefPtr<WorkerScriptLoader> scriptLoader(WorkerScriptLoader::create());
scriptLoader->setRequestContext(blink::WebURLRequest::RequestContextScript);
- scriptLoader->loadSynchronously(executionContext, *it, AllowCrossOriginRequests);
+ scriptLoader->loadSynchronously(executionContext, completeURL, AllowCrossOriginRequests);
// If the fetching attempt failed, throw a NetworkError exception and abort all these steps.
if (scriptLoader->failed()) {
- exceptionState.throwDOMException(NetworkError, "The script at '" + it->elidedString() + "' failed to load.");
+ exceptionState.throwDOMException(NetworkError, "The script at '" + completeURL.elidedString() + "' failed to load.");
return;
}
« no previous file with comments | « Source/core/workers/WorkerEventQueue.cpp ('k') | Source/core/workers/WorkerInspectorProxy.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698