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

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

Issue 594803002: Transfer SecurityOrigin overrides to Workers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename transferPrivileges() to transferPrivilegesFrom() over security origins Created 6 years, 2 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/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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 // shut it down right here. 387 // shut it down right here.
388 delete this; 388 delete this;
389 return; 389 return;
390 } 390 }
391 391
392 Document* document = toWebLocalFrameImpl(m_mainFrame)->frame()->document(); 392 Document* document = toWebLocalFrameImpl(m_mainFrame)->frame()->document();
393 WorkerThreadStartMode startMode = DontPauseWorkerGlobalScopeOnStart; 393 WorkerThreadStartMode startMode = DontPauseWorkerGlobalScopeOnStart;
394 if (InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart(document)) 394 if (InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart(document))
395 startMode = PauseWorkerGlobalScopeOnStart; 395 startMode = PauseWorkerGlobalScopeOnStart;
396 396
397 // FIXME: this document's origin is pristine and without any extra privilege s. (crbug.com/254993)
398 SecurityOrigin* starterOrigin = document->securityOrigin();
399
397 OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create(); 400 OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create();
398 provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::c reate()); 401 provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::c reate());
399 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->securityOrigin()); 402 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->securityOrigin());
400 providePermissionClientToWorker(workerClients.get(), adoptPtr(client()->crea teWorkerPermissionClientProxy(webSecurityOrigin))); 403 providePermissionClientToWorker(workerClients.get(), adoptPtr(client()->crea teWorkerPermissionClientProxy(webSecurityOrigin)));
401 OwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData = WorkerThreadStartu pData::create(m_url, m_loadingDocument->userAgent(m_url), m_mainScriptLoader->sc ript(), startMode, m_contentSecurityPolicy, static_cast<ContentSecurityPolicyHea derType>(m_policyType), workerClients.release()); 404 OwnPtrWillBeRawPtr<WorkerThreadStartupData> startupData = WorkerThreadStartu pData::create(m_url, m_loadingDocument->userAgent(m_url), m_mainScriptLoader->sc ript(), startMode, m_contentSecurityPolicy, static_cast<ContentSecurityPolicyHea derType>(m_policyType), starterOrigin, workerClients.release());
402 setWorkerThread(SharedWorkerThread::create(m_name, *this, *this, startupData .release())); 405 setWorkerThread(SharedWorkerThread::create(m_name, *this, *this, startupData .release()));
403 InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScri ptLoader->identifier(), m_mainScriptLoader->script()); 406 InspectorInstrumentation::scriptImported(m_loadingDocument.get(), m_mainScri ptLoader->identifier(), m_mainScriptLoader->script());
404 m_mainScriptLoader.clear(); 407 m_mainScriptLoader.clear();
405 408
406 workerThread()->start(); 409 workerThread()->start();
407 m_workerInspectorProxy->workerThreadCreated(m_loadingDocument.get(), workerT hread(), m_url); 410 m_workerInspectorProxy->workerThreadCreated(m_loadingDocument.get(), workerT hread(), m_url);
408 if (client()) 411 if (client())
409 client()->workerScriptLoaded(); 412 client()->workerScriptLoaded();
410 } 413 }
411 414
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 if (devtoolsAgent) 460 if (devtoolsAgent)
458 devtoolsAgent->dispatchOnInspectorBackend(message); 461 devtoolsAgent->dispatchOnInspectorBackend(message);
459 } 462 }
460 463
461 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) 464 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client)
462 { 465 {
463 return new WebSharedWorkerImpl(client); 466 return new WebSharedWorkerImpl(client);
464 } 467 }
465 468
466 } // namespace blink 469 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebEmbeddedWorkerImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698