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

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

Issue 2171563002: Add WorkerSettings to expose certain flag values in WorkerGlobalScope (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits Created 4 years, 4 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 | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp ('k') | no next file » | 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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 // FIXME: this document's origin is pristine and without any extra privilege s. (crbug.com/254993) 330 // FIXME: this document's origin is pristine and without any extra privilege s. (crbug.com/254993)
331 SecurityOrigin* starterOrigin = document->getSecurityOrigin(); 331 SecurityOrigin* starterOrigin = document->getSecurityOrigin();
332 332
333 WorkerClients* workerClients = WorkerClients::create(); 333 WorkerClients* workerClients = WorkerClients::create();
334 provideLocalFileSystemToWorker(workerClients, LocalFileSystemClient::create( )); 334 provideLocalFileSystemToWorker(workerClients, LocalFileSystemClient::create( ));
335 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->getSecurityOrigin()); 335 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->getSecurityOrigin());
336 provideContentSettingsClientToWorker(workerClients, wrapUnique(m_client->cre ateWorkerContentSettingsClientProxy(webSecurityOrigin))); 336 provideContentSettingsClientToWorker(workerClients, wrapUnique(m_client->cre ateWorkerContentSettingsClientProxy(webSecurityOrigin)));
337 provideIndexedDBClientToWorker(workerClients, IndexedDBClientImpl::create()) ; 337 provideIndexedDBClientToWorker(workerClients, IndexedDBClientImpl::create()) ;
338 ContentSecurityPolicy* contentSecurityPolicy = m_mainScriptLoader->releaseCo ntentSecurityPolicy(); 338 ContentSecurityPolicy* contentSecurityPolicy = m_mainScriptLoader->releaseCo ntentSecurityPolicy();
339 WorkerThreadStartMode startMode = m_workerInspectorProxy->workerStartMode(do cument); 339 WorkerThreadStartMode startMode = m_workerInspectorProxy->workerStartMode(do cument);
340 std::unique_ptr<WorkerSettings> workerSettings = wrapUnique(new WorkerSettin gs(document->settings()));
340 std::unique_ptr<WorkerThreadStartupData> startupData = WorkerThreadStartupDa ta::create( 341 std::unique_ptr<WorkerThreadStartupData> startupData = WorkerThreadStartupDa ta::create(
341 m_url, 342 m_url,
342 m_loadingDocument->userAgent(), 343 m_loadingDocument->userAgent(),
343 m_mainScriptLoader->script(), 344 m_mainScriptLoader->script(),
344 nullptr, 345 nullptr,
345 startMode, 346 startMode,
346 contentSecurityPolicy ? contentSecurityPolicy->headers().get() : nullptr , 347 contentSecurityPolicy ? contentSecurityPolicy->headers().get() : nullptr ,
347 m_mainScriptLoader->referrerPolicy(), 348 m_mainScriptLoader->referrerPolicy(),
348 starterOrigin, 349 starterOrigin,
349 workerClients, 350 workerClients,
350 m_mainScriptLoader->responseAddressSpace(), 351 m_mainScriptLoader->responseAddressSpace(),
351 m_mainScriptLoader->originTrialTokens()); 352 m_mainScriptLoader->originTrialTokens(),
353 std::move(workerSettings));
352 m_loaderProxy = WorkerLoaderProxy::create(this); 354 m_loaderProxy = WorkerLoaderProxy::create(this);
353 m_workerThread = SharedWorkerThread::create(m_name, m_loaderProxy, *this); 355 m_workerThread = SharedWorkerThread::create(m_name, m_loaderProxy, *this);
354 InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScri ptLoader->identifier(), m_mainScriptLoader->script()); 356 InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScri ptLoader->identifier(), m_mainScriptLoader->script());
355 m_mainScriptLoader.clear(); 357 m_mainScriptLoader.clear();
356 358
357 workerThread()->start(std::move(startupData)); 359 workerThread()->start(std::move(startupData));
358 m_workerInspectorProxy->workerThreadCreated(toDocument(m_loadingDocument.get ()), workerThread(), m_url); 360 m_workerInspectorProxy->workerThreadCreated(toDocument(m_loadingDocument.get ()), workerThread(), m_url);
359 m_client->workerScriptLoaded(); 361 m_client->workerScriptLoaded();
360 } 362 }
361 363
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 if (devtoolsAgent) 401 if (devtoolsAgent)
400 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, mes sage); 402 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, mes sage);
401 } 403 }
402 404
403 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) 405 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client)
404 { 406 {
405 return new WebSharedWorkerImpl(client); 407 return new WebSharedWorkerImpl(client);
406 } 408 }
407 409
408 } // namespace blink 410 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698