| OLD | NEW |
| 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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 loadShadowPage(); | 209 loadShadowPage(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 // WorkerReportingProxy -------------------------------------------------------- | 212 // WorkerReportingProxy -------------------------------------------------------- |
| 213 | 213 |
| 214 void WebSharedWorkerImpl::reportException(const String& errorMessage, int lineNu
mber, int columnNumber, const String& sourceURL, int exceptionId) | 214 void WebSharedWorkerImpl::reportException(const String& errorMessage, int lineNu
mber, int columnNumber, const String& sourceURL, int exceptionId) |
| 215 { | 215 { |
| 216 // Not suppported in SharedWorker. | 216 // Not suppported in SharedWorker. |
| 217 } | 217 } |
| 218 | 218 |
| 219 void WebSharedWorkerImpl::reportConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMes
sage>) | 219 void WebSharedWorkerImpl::reportConsoleMessage(RawPtr<ConsoleMessage>) |
| 220 { | 220 { |
| 221 // Not supported in SharedWorker. | 221 // Not supported in SharedWorker. |
| 222 } | 222 } |
| 223 | 223 |
| 224 void WebSharedWorkerImpl::postMessageToPageInspector(const String& message) | 224 void WebSharedWorkerImpl::postMessageToPageInspector(const String& message) |
| 225 { | 225 { |
| 226 m_mainFrame->frame()->document()->postInspectorTask(BLINK_FROM_HERE, createC
rossThreadTask(&WebSharedWorkerImpl::postMessageToPageInspectorOnMainThread, thi
s, message)); | 226 m_mainFrame->frame()->document()->postInspectorTask(BLINK_FROM_HERE, createC
rossThreadTask(&WebSharedWorkerImpl::postMessageToPageInspectorOnMainThread, thi
s, message)); |
| 227 } | 227 } |
| 228 | 228 |
| 229 void WebSharedWorkerImpl::postMessageToPageInspectorOnMainThread(const String& m
essage) | 229 void WebSharedWorkerImpl::postMessageToPageInspectorOnMainThread(const String& m
essage) |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 } | 322 } |
| 323 | 323 |
| 324 Document* document = m_mainFrame->frame()->document(); | 324 Document* document = m_mainFrame->frame()->document(); |
| 325 WorkerThreadStartMode startMode = DontPauseWorkerGlobalScopeOnStart; | 325 WorkerThreadStartMode startMode = DontPauseWorkerGlobalScopeOnStart; |
| 326 if (InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart(document)) | 326 if (InspectorInstrumentation::shouldPauseDedicatedWorkerOnStart(document)) |
| 327 startMode = PauseWorkerGlobalScopeOnStart; | 327 startMode = PauseWorkerGlobalScopeOnStart; |
| 328 | 328 |
| 329 // FIXME: this document's origin is pristine and without any extra privilege
s. (crbug.com/254993) | 329 // FIXME: this document's origin is pristine and without any extra privilege
s. (crbug.com/254993) |
| 330 SecurityOrigin* starterOrigin = document->securityOrigin(); | 330 SecurityOrigin* starterOrigin = document->securityOrigin(); |
| 331 | 331 |
| 332 OwnPtrWillBeRawPtr<WorkerClients> workerClients = WorkerClients::create(); | 332 RawPtr<WorkerClients> workerClients = WorkerClients::create(); |
| 333 provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::c
reate()); | 333 provideLocalFileSystemToWorker(workerClients.get(), LocalFileSystemClient::c
reate()); |
| 334 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->securityOrigin()); | 334 WebSecurityOrigin webSecurityOrigin(m_loadingDocument->securityOrigin()); |
| 335 provideContentSettingsClientToWorker(workerClients.get(), adoptPtr(m_client-
>createWorkerContentSettingsClientProxy(webSecurityOrigin))); | 335 provideContentSettingsClientToWorker(workerClients.get(), adoptPtr(m_client-
>createWorkerContentSettingsClientProxy(webSecurityOrigin))); |
| 336 RefPtrWillBeRawPtr<ContentSecurityPolicy> contentSecurityPolicy = m_mainScri
ptLoader->releaseContentSecurityPolicy(); | 336 RawPtr<ContentSecurityPolicy> contentSecurityPolicy = m_mainScriptLoader->re
leaseContentSecurityPolicy(); |
| 337 OwnPtr<WorkerThreadStartupData> startupData = WorkerThreadStartupData::creat
e( | 337 OwnPtr<WorkerThreadStartupData> startupData = WorkerThreadStartupData::creat
e( |
| 338 m_url, | 338 m_url, |
| 339 m_loadingDocument->userAgent(), | 339 m_loadingDocument->userAgent(), |
| 340 m_mainScriptLoader->script(), | 340 m_mainScriptLoader->script(), |
| 341 nullptr, | 341 nullptr, |
| 342 startMode, | 342 startMode, |
| 343 contentSecurityPolicy ? contentSecurityPolicy->headers() : nullptr, | 343 contentSecurityPolicy ? contentSecurityPolicy->headers() : nullptr, |
| 344 starterOrigin, | 344 starterOrigin, |
| 345 workerClients.release()); | 345 workerClients.release()); |
| 346 m_loaderProxy = WorkerLoaderProxy::create(this); | 346 m_loaderProxy = WorkerLoaderProxy::create(this); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 if (devtoolsAgent) | 393 if (devtoolsAgent) |
| 394 devtoolsAgent->dispatchOnInspectorBackend(sessionId, message); | 394 devtoolsAgent->dispatchOnInspectorBackend(sessionId, message); |
| 395 } | 395 } |
| 396 | 396 |
| 397 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) | 397 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) |
| 398 { | 398 { |
| 399 return new WebSharedWorkerImpl(client); | 399 return new WebSharedWorkerImpl(client); |
| 400 } | 400 } |
| 401 | 401 |
| 402 } // namespace blink | 402 } // namespace blink |
| OLD | NEW |