| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "core/workers/WorkerClients.h" | 49 #include "core/workers/WorkerClients.h" |
| 50 #include "core/workers/WorkerConsole.h" | 50 #include "core/workers/WorkerConsole.h" |
| 51 #include "core/workers/WorkerLocation.h" | 51 #include "core/workers/WorkerLocation.h" |
| 52 #include "core/workers/WorkerNavigator.h" | 52 #include "core/workers/WorkerNavigator.h" |
| 53 #include "core/workers/WorkerReportingProxy.h" | 53 #include "core/workers/WorkerReportingProxy.h" |
| 54 #include "core/workers/WorkerScriptLoader.h" | 54 #include "core/workers/WorkerScriptLoader.h" |
| 55 #include "core/workers/WorkerThread.h" | 55 #include "core/workers/WorkerThread.h" |
| 56 #include "platform/network/ContentSecurityPolicyParsers.h" | 56 #include "platform/network/ContentSecurityPolicyParsers.h" |
| 57 #include "platform/weborigin/KURL.h" | 57 #include "platform/weborigin/KURL.h" |
| 58 #include "platform/weborigin/SecurityOrigin.h" | 58 #include "platform/weborigin/SecurityOrigin.h" |
| 59 #include "public/platform/WebURLRequest.h" |
| 59 | 60 |
| 60 namespace WebCore { | 61 namespace WebCore { |
| 61 | 62 |
| 62 class CloseWorkerGlobalScopeTask : public ExecutionContextTask { | 63 class CloseWorkerGlobalScopeTask : public ExecutionContextTask { |
| 63 public: | 64 public: |
| 64 static PassOwnPtr<CloseWorkerGlobalScopeTask> create() | 65 static PassOwnPtr<CloseWorkerGlobalScopeTask> create() |
| 65 { | 66 { |
| 66 return adoptPtr(new CloseWorkerGlobalScopeTask); | 67 return adoptPtr(new CloseWorkerGlobalScopeTask); |
| 67 } | 68 } |
| 68 | 69 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 if (!contentSecurityPolicy()->allowScriptFromSource(url)) { | 243 if (!contentSecurityPolicy()->allowScriptFromSource(url)) { |
| 243 exceptionState.throwDOMException(NetworkError, "The script at '" + u
rl.elidedString() + "' failed to load."); | 244 exceptionState.throwDOMException(NetworkError, "The script at '" + u
rl.elidedString() + "' failed to load."); |
| 244 return; | 245 return; |
| 245 } | 246 } |
| 246 completedURLs.append(url); | 247 completedURLs.append(url); |
| 247 } | 248 } |
| 248 Vector<KURL>::const_iterator end = completedURLs.end(); | 249 Vector<KURL>::const_iterator end = completedURLs.end(); |
| 249 | 250 |
| 250 for (Vector<KURL>::const_iterator it = completedURLs.begin(); it != end; ++i
t) { | 251 for (Vector<KURL>::const_iterator it = completedURLs.begin(); it != end; ++i
t) { |
| 251 RefPtr<WorkerScriptLoader> scriptLoader(WorkerScriptLoader::create()); | 252 RefPtr<WorkerScriptLoader> scriptLoader(WorkerScriptLoader::create()); |
| 252 scriptLoader->setTargetType(ResourceRequest::TargetIsScript); | 253 scriptLoader->setRequestContext(blink::WebURLRequest::RequestContextScri
pt); |
| 253 scriptLoader->loadSynchronously(executionContext, *it, AllowCrossOriginR
equests); | 254 scriptLoader->loadSynchronously(executionContext, *it, AllowCrossOriginR
equests); |
| 254 | 255 |
| 255 // If the fetching attempt failed, throw a NetworkError exception and ab
ort all these steps. | 256 // If the fetching attempt failed, throw a NetworkError exception and ab
ort all these steps. |
| 256 if (scriptLoader->failed()) { | 257 if (scriptLoader->failed()) { |
| 257 exceptionState.throwDOMException(NetworkError, "The script at '" + i
t->elidedString() + "' failed to load."); | 258 exceptionState.throwDOMException(NetworkError, "The script at '" + i
t->elidedString() + "' failed to load."); |
| 258 return; | 259 return; |
| 259 } | 260 } |
| 260 | 261 |
| 261 InspectorInstrumentation::scriptImported(&executionContext, scriptLoader
->identifier(), scriptLoader->script()); | 262 InspectorInstrumentation::scriptImported(&executionContext, scriptLoader
->identifier(), scriptLoader->script()); |
| 262 | 263 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 visitor->trace(m_location); | 340 visitor->trace(m_location); |
| 340 visitor->trace(m_navigator); | 341 visitor->trace(m_navigator); |
| 341 visitor->trace(m_eventQueue); | 342 visitor->trace(m_eventQueue); |
| 342 visitor->trace(m_workerClients); | 343 visitor->trace(m_workerClients); |
| 343 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor); | 344 WillBeHeapSupplementable<WorkerGlobalScope>::trace(visitor); |
| 344 ExecutionContext::trace(visitor); | 345 ExecutionContext::trace(visitor); |
| 345 EventTargetWithInlineData::trace(visitor); | 346 EventTargetWithInlineData::trace(visitor); |
| 346 } | 347 } |
| 347 | 348 |
| 348 } // namespace WebCore | 349 } // namespace WebCore |
| OLD | NEW |