Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: Source/core/workers/WorkerGlobalScope.cpp

Issue 360233005: Replace 'ResourceRequest::TargetType' with 'ResourceRequest::RequestContext'. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Uninitialized === crash. :( Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/loader/PingLoader.cpp ('k') | Source/core/workers/WorkerScriptLoader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « Source/core/loader/PingLoader.cpp ('k') | Source/core/workers/WorkerScriptLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698