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

Side by Side Diff: Source/web/WebSharedWorkerImpl.cpp

Issue 102243010: Move the worker script loading code to the worker process (phase:1/5) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 6 years, 11 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
« no previous file with comments | « Source/web/SharedWorkerRepositoryClientImpl.cpp ('k') | public/web/WebSharedWorkerClient.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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 // We can't get the SecurityOrigin from the Document, because the Document w ill be created asynchronously. 241 // We can't get the SecurityOrigin from the Document, because the Document w ill be created asynchronously.
242 // Normally it's not safe to create a new SecurityOrigin from the same url a nd assume it will be the same, but the 242 // Normally it's not safe to create a new SecurityOrigin from the same url a nd assume it will be the same, but the
243 // cases where that's risky aren't applicable here. They involve being in an iframe (e.g., sandbox origin or 243 // cases where that's risky aren't applicable here. They involve being in an iframe (e.g., sandbox origin or
244 // about:blank in a new iframe), and this codepath is always working with a main frame. 244 // about:blank in a new iframe), and this codepath is always working with a main frame.
245 WebSecurityOrigin webSecurityOrigin = WebSecurityOrigin::create(url); 245 WebSecurityOrigin webSecurityOrigin = WebSecurityOrigin::create(url);
246 providePermissionClientToWorker(workerClients.get(), adoptPtr(client()->crea teWorkerPermissionClientProxy(webSecurityOrigin))); 246 providePermissionClientToWorker(workerClients.get(), adoptPtr(client()->crea teWorkerPermissionClientProxy(webSecurityOrigin)));
247 OwnPtr<WorkerThreadStartupData> startupData = WorkerThreadStartupData::creat e(url, userAgent, sourceCode, startMode, contentSecurityPolicy, static_cast<WebC ore::ContentSecurityPolicy::HeaderType>(policyType), workerClients.release()); 247 OwnPtr<WorkerThreadStartupData> startupData = WorkerThreadStartupData::creat e(url, userAgent, sourceCode, startMode, contentSecurityPolicy, static_cast<WebC ore::ContentSecurityPolicy::HeaderType>(policyType), workerClients.release());
248 setWorkerThread(SharedWorkerThread::create(name, *this, *this, startupData.r elease())); 248 setWorkerThread(SharedWorkerThread::create(name, *this, *this, startupData.r elease()));
249 249
250 workerThread()->start(); 250 workerThread()->start();
251 // FIXME(horo): This call will be moved when we implement script loading in WebSharedWorkerImpl.
252 if (client())
253 client()->workerScriptLoaded();
251 } 254 }
252 255
253 void WebSharedWorkerImpl::terminateWorkerContext() 256 void WebSharedWorkerImpl::terminateWorkerContext()
254 { 257 {
255 stopWorkerThread(); 258 stopWorkerThread();
256 } 259 }
257 260
258 void WebSharedWorkerImpl::clientDestroyed() 261 void WebSharedWorkerImpl::clientDestroyed()
259 { 262 {
260 m_client.clear(); 263 m_client.clear();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 workerThread()->runLoop().postTaskForMode(createCallbackTask(dispatchOnInspe ctorBackendTask, String(message)), WorkerDebuggerAgent::debuggerTaskMode); 322 workerThread()->runLoop().postTaskForMode(createCallbackTask(dispatchOnInspe ctorBackendTask, String(message)), WorkerDebuggerAgent::debuggerTaskMode);
320 WorkerDebuggerAgent::interruptAndDispatchInspectorCommands(workerThread()); 323 WorkerDebuggerAgent::interruptAndDispatchInspectorCommands(workerThread());
321 } 324 }
322 325
323 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) 326 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client)
324 { 327 {
325 return new WebSharedWorkerImpl(client); 328 return new WebSharedWorkerImpl(client);
326 } 329 }
327 330
328 } // namespace blink 331 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/SharedWorkerRepositoryClientImpl.cpp ('k') | public/web/WebSharedWorkerClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698