| 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;
|
| }
|
|
|
|
|