| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 #include "core/page/DOMTimer.h" | 46 #include "core/page/DOMTimer.h" |
| 47 #include "core/page/DOMWindow.h" | 47 #include "core/page/DOMWindow.h" |
| 48 #include "core/page/SecurityOrigin.h" | 48 #include "core/page/SecurityOrigin.h" |
| 49 #include "core/page/WorkerNavigator.h" | 49 #include "core/page/WorkerNavigator.h" |
| 50 #include "core/platform/KURL.h" | 50 #include "core/platform/KURL.h" |
| 51 #include "core/platform/NotImplemented.h" | 51 #include "core/platform/NotImplemented.h" |
| 52 #include "core/workers/WorkerLocation.h" | 52 #include "core/workers/WorkerLocation.h" |
| 53 #include "core/workers/WorkerObjectProxy.h" | 53 #include "core/workers/WorkerObjectProxy.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 "core/xml/XMLHttpRequestException.h" | |
| 57 #include <wtf/RefPtr.h> | 56 #include <wtf/RefPtr.h> |
| 58 #include <wtf/UnusedParam.h> | 57 #include <wtf/UnusedParam.h> |
| 59 | 58 |
| 60 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) | 59 #if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS) |
| 61 #include "modules/notifications/NotificationCenter.h" | 60 #include "modules/notifications/NotificationCenter.h" |
| 62 #endif | 61 #endif |
| 63 | 62 |
| 64 #include "core/dom/ExceptionCode.h" | 63 #include "core/dom/ExceptionCode.h" |
| 65 | 64 |
| 66 namespace WebCore { | 65 namespace WebCore { |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 237 } |
| 239 Vector<KURL>::const_iterator end = completedURLs.end(); | 238 Vector<KURL>::const_iterator end = completedURLs.end(); |
| 240 | 239 |
| 241 for (Vector<KURL>::const_iterator it = completedURLs.begin(); it != end; ++i
t) { | 240 for (Vector<KURL>::const_iterator it = completedURLs.begin(); it != end; ++i
t) { |
| 242 RefPtr<WorkerScriptLoader> scriptLoader(WorkerScriptLoader::create()); | 241 RefPtr<WorkerScriptLoader> scriptLoader(WorkerScriptLoader::create()); |
| 243 scriptLoader->setTargetType(ResourceRequest::TargetIsScript); | 242 scriptLoader->setTargetType(ResourceRequest::TargetIsScript); |
| 244 scriptLoader->loadSynchronously(scriptExecutionContext(), *it, AllowCros
sOriginRequests); | 243 scriptLoader->loadSynchronously(scriptExecutionContext(), *it, AllowCros
sOriginRequests); |
| 245 | 244 |
| 246 // If the fetching attempt failed, throw a NETWORK_ERR exception and abo
rt all these steps. | 245 // If the fetching attempt failed, throw a NETWORK_ERR exception and abo
rt all these steps. |
| 247 if (scriptLoader->failed()) { | 246 if (scriptLoader->failed()) { |
| 248 ec = XMLHttpRequestException::NETWORK_ERR; | 247 ec = NETWORK_ERR; |
| 249 return; | 248 return; |
| 250 } | 249 } |
| 251 | 250 |
| 252 InspectorInstrumentation::scriptImported(scriptExecutionContext(), scrip
tLoader->identifier(), scriptLoader->script()); | 251 InspectorInstrumentation::scriptImported(scriptExecutionContext(), scrip
tLoader->identifier(), scriptLoader->script()); |
| 253 | 252 |
| 254 ScriptValue exception; | 253 ScriptValue exception; |
| 255 m_script->evaluate(ScriptSourceCode(scriptLoader->script(), scriptLoader
->responseURL()), &exception); | 254 m_script->evaluate(ScriptSourceCode(scriptLoader->script(), scriptLoader
->responseURL()), &exception); |
| 256 if (!exception.hasNoValue()) { | 255 if (!exception.hasNoValue()) { |
| 257 m_script->setException(exception); | 256 m_script->setException(exception); |
| 258 return; | 257 return; |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 iter = m_workerObservers.begin(); | 365 iter = m_workerObservers.begin(); |
| 367 } | 366 } |
| 368 } | 367 } |
| 369 | 368 |
| 370 WorkerEventQueue* WorkerContext::eventQueue() const | 369 WorkerEventQueue* WorkerContext::eventQueue() const |
| 371 { | 370 { |
| 372 return m_eventQueue.get(); | 371 return m_eventQueue.get(); |
| 373 } | 372 } |
| 374 | 373 |
| 375 } // namespace WebCore | 374 } // namespace WebCore |
| OLD | NEW |