| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 #include "core/workers/WorkerScriptLoader.h" | 43 #include "core/workers/WorkerScriptLoader.h" |
| 44 #include "core/workers/WorkerScriptLoaderClient.h" | 44 #include "core/workers/WorkerScriptLoaderClient.h" |
| 45 #include "core/workers/WorkerThreadStartupData.h" | 45 #include "core/workers/WorkerThreadStartupData.h" |
| 46 #include "modules/serviceworkers/ServiceWorkerThread.h" | 46 #include "modules/serviceworkers/ServiceWorkerThread.h" |
| 47 #include "platform/NotImplemented.h" | 47 #include "platform/NotImplemented.h" |
| 48 #include "platform/SharedBuffer.h" | 48 #include "platform/SharedBuffer.h" |
| 49 #include "platform/heap/Handle.h" | 49 #include "platform/heap/Handle.h" |
| 50 #include "platform/network/ContentSecurityPolicyParsers.h" | 50 #include "platform/network/ContentSecurityPolicyParsers.h" |
| 51 #include "public/web/WebServiceWorkerContextClient.h" | 51 #include "public/web/WebServiceWorkerContextClient.h" |
| 52 #include "public/web/WebServiceWorkerNetworkProvider.h" | 52 #include "public/web/WebServiceWorkerNetworkProvider.h" |
| 53 #include "public/web/WebSettings.h" |
| 53 #include "public/web/WebView.h" | 54 #include "public/web/WebView.h" |
| 54 #include "public/web/WebWorkerPermissionClientProxy.h" | 55 #include "public/web/WebWorkerPermissionClientProxy.h" |
| 55 #include "web/ServiceWorkerGlobalScopeClientImpl.h" | 56 #include "web/ServiceWorkerGlobalScopeClientImpl.h" |
| 56 #include "web/ServiceWorkerGlobalScopeProxy.h" | 57 #include "web/ServiceWorkerGlobalScopeProxy.h" |
| 57 #include "web/WebDataSourceImpl.h" | 58 #include "web/WebDataSourceImpl.h" |
| 58 #include "web/WebLocalFrameImpl.h" | 59 #include "web/WebLocalFrameImpl.h" |
| 59 #include "web/WorkerPermissionClient.h" | 60 #include "web/WorkerPermissionClient.h" |
| 60 #include "wtf/Functional.h" | 61 #include "wtf/Functional.h" |
| 61 | 62 |
| 62 using namespace WebCore; | 63 using namespace WebCore; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 void WebEmbeddedWorkerImpl::prepareShadowPageForLoader() | 250 void WebEmbeddedWorkerImpl::prepareShadowPageForLoader() |
| 250 { | 251 { |
| 251 // Create 'shadow page', which is never displayed and is used mainly to | 252 // Create 'shadow page', which is never displayed and is used mainly to |
| 252 // provide a context for loading on the main thread. | 253 // provide a context for loading on the main thread. |
| 253 // | 254 // |
| 254 // FIXME: This does mostly same as WebSharedWorkerImpl::initializeLoader. | 255 // FIXME: This does mostly same as WebSharedWorkerImpl::initializeLoader. |
| 255 // This code, and probably most of the code in this class should be shared | 256 // This code, and probably most of the code in this class should be shared |
| 256 // with SharedWorker. | 257 // with SharedWorker. |
| 257 ASSERT(!m_webView); | 258 ASSERT(!m_webView); |
| 258 m_webView = WebView::create(0); | 259 m_webView = WebView::create(0); |
| 260 // FIXME: http://crbug.com/363843. This needs to find a better way to |
| 261 // not create graphics layers. |
| 262 m_webView->settings()->setAcceleratedCompositingEnabled(false); |
| 259 m_mainFrame = WebLocalFrame::create(this); | 263 m_mainFrame = WebLocalFrame::create(this); |
| 260 m_webView->setMainFrame(m_mainFrame); | 264 m_webView->setMainFrame(m_mainFrame); |
| 261 | 265 |
| 262 WebLocalFrameImpl* webFrame = toWebLocalFrameImpl(m_webView->mainFrame()); | 266 WebLocalFrameImpl* webFrame = toWebLocalFrameImpl(m_webView->mainFrame()); |
| 263 | 267 |
| 264 // Construct substitute data source for the 'shadow page'. We only need it | 268 // Construct substitute data source for the 'shadow page'. We only need it |
| 265 // to have same origin as the worker so the loading checks work correctly. | 269 // to have same origin as the worker so the loading checks work correctly. |
| 266 CString content(""); | 270 CString content(""); |
| 267 int length = static_cast<int>(content.length()); | 271 int length = static_cast<int>(content.length()); |
| 268 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), length)); | 272 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), length)); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 m_mainScriptLoader.clear(); | 328 m_mainScriptLoader.clear(); |
| 325 | 329 |
| 326 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *toW
ebLocalFrameImpl(m_mainFrame)->frame()->document(), *m_workerContextClient); | 330 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *toW
ebLocalFrameImpl(m_mainFrame)->frame()->document(), *m_workerContextClient); |
| 327 m_loaderProxy = LoaderProxy::create(*this); | 331 m_loaderProxy = LoaderProxy::create(*this); |
| 328 | 332 |
| 329 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal
ScopeProxy, startupData.release()); | 333 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal
ScopeProxy, startupData.release()); |
| 330 m_workerThread->start(); | 334 m_workerThread->start(); |
| 331 } | 335 } |
| 332 | 336 |
| 333 } // namespace blink | 337 } // namespace blink |
| OLD | NEW |