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

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

Issue 204983007: Make ThreadableLoader class to use references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Changes per review commets Created 6 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 worker->suspendIfNeeded(); 67 worker->suspendIfNeeded();
68 68
69 KURL scriptURL = worker->resolveURL(url, exceptionState); 69 KURL scriptURL = worker->resolveURL(url, exceptionState);
70 if (scriptURL.isEmpty()) 70 if (scriptURL.isEmpty())
71 return nullptr; 71 return nullptr;
72 72
73 // The worker context does not exist while loading, so we must ensure that t he worker object is not collected, nor are its event listeners. 73 // The worker context does not exist while loading, so we must ensure that t he worker object is not collected, nor are its event listeners.
74 worker->setPendingActivity(worker.get()); 74 worker->setPendingActivity(worker.get());
75 75
76 worker->m_scriptLoader = WorkerScriptLoader::create(); 76 worker->m_scriptLoader = WorkerScriptLoader::create();
77 worker->m_scriptLoader->loadAsynchronously(context, scriptURL, DenyCrossOrig inRequests, worker.get()); 77 worker->m_scriptLoader->loadAsynchronously(*context, scriptURL, DenyCrossOri ginRequests, worker.get());
78 worker->m_contextProxy = proxyProvider->createWorkerGlobalScopeProxy(worker. get()); 78 worker->m_contextProxy = proxyProvider->createWorkerGlobalScopeProxy(worker. get());
79 return worker.release(); 79 return worker.release();
80 } 80 }
81 81
82 Worker::~Worker() 82 Worker::~Worker()
83 { 83 {
84 ASSERT(isMainThread()); 84 ASSERT(isMainThread());
85 ASSERT(executionContext()); // The context is protected by worker context pr oxy, so it cannot be destroyed while a Worker exists. 85 ASSERT(executionContext()); // The context is protected by worker context pr oxy, so it cannot be destroyed while a Worker exists.
86 if (m_contextProxy) 86 if (m_contextProxy)
87 m_contextProxy->workerObjectDestroyed(); 87 m_contextProxy->workerObjectDestroyed();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 unsetPendingActivity(this); 138 unsetPendingActivity(this);
139 } 139 }
140 140
141 void Worker::trace(Visitor* visitor) 141 void Worker::trace(Visitor* visitor)
142 { 142 {
143 AbstractWorker::trace(visitor); 143 AbstractWorker::trace(visitor);
144 } 144 }
145 145
146 } // namespace WebCore 146 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698