OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. | 3 * Copyright (C) 2009, 2011 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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 } | 249 } |
250 if (!contentSecurityPolicy()->allowScriptFromSource(url)) { | 250 if (!contentSecurityPolicy()->allowScriptFromSource(url)) { |
251 exceptionState.throwDOMException(NetworkError, "The script at '" + u
rl.elidedString() + "' failed to load."); | 251 exceptionState.throwDOMException(NetworkError, "The script at '" + u
rl.elidedString() + "' failed to load."); |
252 return; | 252 return; |
253 } | 253 } |
254 completedURLs.append(url); | 254 completedURLs.append(url); |
255 } | 255 } |
256 | 256 |
257 for (const KURL& completeURL : completedURLs) { | 257 for (const KURL& completeURL : completedURLs) { |
258 RefPtr<WorkerScriptLoader> scriptLoader(WorkerScriptLoader::create()); | 258 RefPtr<WorkerScriptLoader> scriptLoader(WorkerScriptLoader::create()); |
259 scriptLoader->setRequestContext(blink::WebURLRequest::RequestContextScri
pt); | 259 scriptLoader->setRequestContext(WebURLRequest::RequestContextScript); |
260 scriptLoader->loadSynchronously(executionContext, completeURL, AllowCros
sOriginRequests); | 260 scriptLoader->loadSynchronously(executionContext, completeURL, AllowCros
sOriginRequests); |
261 | 261 |
262 // If the fetching attempt failed, throw a NetworkError exception and ab
ort all these steps. | 262 // If the fetching attempt failed, throw a NetworkError exception and ab
ort all these steps. |
263 if (scriptLoader->failed()) { | 263 if (scriptLoader->failed()) { |
264 exceptionState.throwDOMException(NetworkError, "The script at '" + c
ompleteURL.elidedString() + "' failed to load."); | 264 exceptionState.throwDOMException(NetworkError, "The script at '" + c
ompleteURL.elidedString() + "' failed to load."); |
265 return; | 265 return; |
266 } | 266 } |
267 | 267 |
268 InspectorInstrumentation::scriptImported(&executionContext, scriptLoader
->identifier(), scriptLoader->script()); | 268 InspectorInstrumentation::scriptImported(&executionContext, scriptLoader
->identifier(), scriptLoader->script()); |
269 scriptLoaded(scriptLoader->script().length(), scriptLoader->cachedMetada
ta() ? scriptLoader->cachedMetadata()->size() : 0); | 269 scriptLoaded(scriptLoader->script().length(), scriptLoader->cachedMetada
ta() ? scriptLoader->cachedMetadata()->size() : 0); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 visitor->trace(m_timers); | 410 visitor->trace(m_timers); |
411 visitor->trace(m_messageStorage); | 411 visitor->trace(m_messageStorage); |
412 visitor->trace(m_pendingMessages); | 412 visitor->trace(m_pendingMessages); |
413 HeapSupplementable<WorkerGlobalScope>::trace(visitor); | 413 HeapSupplementable<WorkerGlobalScope>::trace(visitor); |
414 #endif | 414 #endif |
415 ExecutionContext::trace(visitor); | 415 ExecutionContext::trace(visitor); |
416 EventTargetWithInlineData::trace(visitor); | 416 EventTargetWithInlineData::trace(visitor); |
417 } | 417 } |
418 | 418 |
419 } // namespace blink | 419 } // namespace blink |
OLD | NEW |