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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 206 |
207 void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionCode&
ec) | 207 void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionCode&
ec) |
208 { | 208 { |
209 ASSERT(contentSecurityPolicy()); | 209 ASSERT(contentSecurityPolicy()); |
210 ec = 0; | 210 ec = 0; |
211 Vector<String>::const_iterator urlsEnd = urls.end(); | 211 Vector<String>::const_iterator urlsEnd = urls.end(); |
212 Vector<KURL> completedURLs; | 212 Vector<KURL> completedURLs; |
213 for (Vector<String>::const_iterator it = urls.begin(); it != urlsEnd; ++it)
{ | 213 for (Vector<String>::const_iterator it = urls.begin(); it != urlsEnd; ++it)
{ |
214 const KURL& url = scriptExecutionContext()->completeURL(*it); | 214 const KURL& url = scriptExecutionContext()->completeURL(*it); |
215 if (!url.isValid()) { | 215 if (!url.isValid()) { |
216 ec = SYNTAX_ERR; | 216 ec = SyntaxError; |
217 return; | 217 return; |
218 } | 218 } |
219 completedURLs.append(url); | 219 completedURLs.append(url); |
220 } | 220 } |
221 Vector<KURL>::const_iterator end = completedURLs.end(); | 221 Vector<KURL>::const_iterator end = completedURLs.end(); |
222 | 222 |
223 for (Vector<KURL>::const_iterator it = completedURLs.begin(); it != end; ++i
t) { | 223 for (Vector<KURL>::const_iterator it = completedURLs.begin(); it != end; ++i
t) { |
224 RefPtr<WorkerScriptLoader> scriptLoader(WorkerScriptLoader::create()); | 224 RefPtr<WorkerScriptLoader> scriptLoader(WorkerScriptLoader::create()); |
225 scriptLoader->setTargetType(ResourceRequest::TargetIsScript); | 225 scriptLoader->setTargetType(ResourceRequest::TargetIsScript); |
226 scriptLoader->loadSynchronously(scriptExecutionContext(), *it, AllowCros
sOriginRequests); | 226 scriptLoader->loadSynchronously(scriptExecutionContext(), *it, AllowCros
sOriginRequests); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 iter = m_workerObservers.begin(); | 348 iter = m_workerObservers.begin(); |
349 } | 349 } |
350 } | 350 } |
351 | 351 |
352 WorkerEventQueue* WorkerGlobalScope::eventQueue() const | 352 WorkerEventQueue* WorkerGlobalScope::eventQueue() const |
353 { | 353 { |
354 return m_eventQueue.get(); | 354 return m_eventQueue.get(); |
355 } | 355 } |
356 | 356 |
357 } // namespace WebCore | 357 } // namespace WebCore |
OLD | NEW |