| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // infrastructure. | 125 // infrastructure. |
| 126 DCHECK(!m_webView); | 126 DCHECK(!m_webView); |
| 127 m_webView = WebView::create(nullptr, WebPageVisibilityStateVisible); | 127 m_webView = WebView::create(nullptr, WebPageVisibilityStateVisible); |
| 128 // FIXME: http://crbug.com/363843. This needs to find a better way to | 128 // FIXME: http://crbug.com/363843. This needs to find a better way to |
| 129 // not create graphics layers. | 129 // not create graphics layers. |
| 130 m_webView->settings()->setAcceleratedCompositingEnabled(false); | 130 m_webView->settings()->setAcceleratedCompositingEnabled(false); |
| 131 // FIXME: Settings information should be passed to the Worker process from | 131 // FIXME: Settings information should be passed to the Worker process from |
| 132 // Browser process when the worker is created (similar to | 132 // Browser process when the worker is created (similar to |
| 133 // RenderThread::OnCreateNewView). | 133 // RenderThread::OnCreateNewView). |
| 134 m_mainFrame = toWebLocalFrameImpl( | 134 m_mainFrame = toWebLocalFrameImpl( |
| 135 WebLocalFrame::create(WebTreeScopeType::Document, this)); | 135 WebLocalFrame::create(WebTreeScopeType::Document, this, |
| 136 Platform::current()->interfaceProvider(), nullptr)); |
| 136 m_webView->setMainFrame(m_mainFrame.get()); | 137 m_webView->setMainFrame(m_mainFrame.get()); |
| 137 m_mainFrame->setDevToolsAgentClient(this); | 138 m_mainFrame->setDevToolsAgentClient(this); |
| 138 | 139 |
| 139 // If we were asked to pause worker context on start and wait for debugger | 140 // If we were asked to pause worker context on start and wait for debugger |
| 140 // then it is the good time to do that. | 141 // then it is the good time to do that. |
| 141 m_client->workerReadyForInspection(); | 142 m_client->workerReadyForInspection(); |
| 142 if (m_pauseWorkerContextOnStart) { | 143 if (m_pauseWorkerContextOnStart) { |
| 143 m_isPausedOnStart = true; | 144 m_isPausedOnStart = true; |
| 144 return; | 145 return; |
| 145 } | 146 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 return m_networkProvider && | 194 return m_networkProvider && |
| 194 m_networkProvider->isControlledByServiceWorker(dataSource); | 195 m_networkProvider->isControlledByServiceWorker(dataSource); |
| 195 } | 196 } |
| 196 | 197 |
| 197 int64_t WebSharedWorkerImpl::serviceWorkerID(WebDataSource& dataSource) { | 198 int64_t WebSharedWorkerImpl::serviceWorkerID(WebDataSource& dataSource) { |
| 198 if (!m_networkProvider) | 199 if (!m_networkProvider) |
| 199 return -1; | 200 return -1; |
| 200 return m_networkProvider->serviceWorkerID(dataSource); | 201 return m_networkProvider->serviceWorkerID(dataSource); |
| 201 } | 202 } |
| 202 | 203 |
| 203 InterfaceProvider* WebSharedWorkerImpl::interfaceProvider() { | |
| 204 return Platform::current()->interfaceProvider(); | |
| 205 } | |
| 206 | |
| 207 void WebSharedWorkerImpl::sendProtocolMessage(int sessionId, | 204 void WebSharedWorkerImpl::sendProtocolMessage(int sessionId, |
| 208 int callId, | 205 int callId, |
| 209 const WebString& message, | 206 const WebString& message, |
| 210 const WebString& state) { | 207 const WebString& state) { |
| 211 m_client->sendDevToolsMessage(sessionId, callId, message, state); | 208 m_client->sendDevToolsMessage(sessionId, callId, message, state); |
| 212 } | 209 } |
| 213 | 210 |
| 214 void WebSharedWorkerImpl::resumeStartup() { | 211 void WebSharedWorkerImpl::resumeStartup() { |
| 215 bool isPausedOnStart = m_isPausedOnStart; | 212 bool isPausedOnStart = m_isPausedOnStart; |
| 216 m_isPausedOnStart = false; | 213 m_isPausedOnStart = false; |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 if (devtoolsAgent) | 459 if (devtoolsAgent) |
| 463 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, | 460 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, |
| 464 message); | 461 message); |
| 465 } | 462 } |
| 466 | 463 |
| 467 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) { | 464 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) { |
| 468 return new WebSharedWorkerImpl(client); | 465 return new WebSharedWorkerImpl(client); |
| 469 } | 466 } |
| 470 | 467 |
| 471 } // namespace blink | 468 } // namespace blink |
| OLD | NEW |