| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 #include "web/WorkerContentSettingsClient.h" | 74 #include "web/WorkerContentSettingsClient.h" |
| 75 #include "wtf/Functional.h" | 75 #include "wtf/Functional.h" |
| 76 #include "wtf/MainThread.h" | 76 #include "wtf/MainThread.h" |
| 77 | 77 |
| 78 namespace blink { | 78 namespace blink { |
| 79 | 79 |
| 80 // TODO(toyoshim): Share implementation with WebEmbeddedWorkerImpl as much as | 80 // TODO(toyoshim): Share implementation with WebEmbeddedWorkerImpl as much as |
| 81 // possible. | 81 // possible. |
| 82 | 82 |
| 83 WebSharedWorkerImpl::WebSharedWorkerImpl(WebSharedWorkerClient* client) | 83 WebSharedWorkerImpl::WebSharedWorkerImpl(WebSharedWorkerClient* client) |
| 84 : m_webView(0) | 84 : m_webView(nullptr) |
| 85 , m_mainFrame(0) | 85 , m_mainFrame(nullptr) |
| 86 , m_askedToTerminate(false) | 86 , m_askedToTerminate(false) |
| 87 , m_workerInspectorProxy(WorkerInspectorProxy::create()) | 87 , m_workerInspectorProxy(WorkerInspectorProxy::create()) |
| 88 , m_client(client) | 88 , m_client(client) |
| 89 , m_pauseWorkerContextOnStart(false) | 89 , m_pauseWorkerContextOnStart(false) |
| 90 , m_isPausedOnStart(false) | 90 , m_isPausedOnStart(false) |
| 91 { | 91 { |
| 92 } | 92 } |
| 93 | 93 |
| 94 WebSharedWorkerImpl::~WebSharedWorkerImpl() | 94 WebSharedWorkerImpl::~WebSharedWorkerImpl() |
| 95 { | 95 { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 126 // loading requests from the worker context to the rest of WebKit and Chromi
um | 126 // loading requests from the worker context to the rest of WebKit and Chromi
um |
| 127 // infrastructure. | 127 // infrastructure. |
| 128 ASSERT(!m_webView); | 128 ASSERT(!m_webView); |
| 129 m_webView = WebView::create(0); | 129 m_webView = WebView::create(0); |
| 130 // FIXME: http://crbug.com/363843. This needs to find a better way to | 130 // FIXME: http://crbug.com/363843. This needs to find a better way to |
| 131 // not create graphics layers. | 131 // not create graphics layers. |
| 132 m_webView->settings()->setAcceleratedCompositingEnabled(false); | 132 m_webView->settings()->setAcceleratedCompositingEnabled(false); |
| 133 // FIXME: Settings information should be passed to the Worker process from B
rowser process when the worker | 133 // FIXME: Settings information should be passed to the Worker process from B
rowser process when the worker |
| 134 // is created (similar to RenderThread::OnCreateNewView). | 134 // is created (similar to RenderThread::OnCreateNewView). |
| 135 m_mainFrame = toWebLocalFrameImpl(WebLocalFrame::create(WebTreeScopeType::Do
cument, this)); | 135 m_mainFrame = toWebLocalFrameImpl(WebLocalFrame::create(WebTreeScopeType::Do
cument, this)); |
| 136 m_webView->setMainFrame(m_mainFrame); | 136 m_webView->setMainFrame(m_mainFrame.get()); |
| 137 m_mainFrame->setDevToolsAgentClient(this); | 137 m_mainFrame->setDevToolsAgentClient(this); |
| 138 | 138 |
| 139 // If we were asked to pause worker context on start and wait for debugger t
hen it is the good time to do that. | 139 // If we were asked to pause worker context on start and wait for debugger t
hen it is the good time to do that. |
| 140 m_client->workerReadyForInspection(); | 140 m_client->workerReadyForInspection(); |
| 141 if (m_pauseWorkerContextOnStart) { | 141 if (m_pauseWorkerContextOnStart) { |
| 142 m_isPausedOnStart = true; | 142 m_isPausedOnStart = true; |
| 143 return; | 143 return; |
| 144 } | 144 } |
| 145 loadShadowPage(); | 145 loadShadowPage(); |
| 146 } | 146 } |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 if (devtoolsAgent) | 394 if (devtoolsAgent) |
| 395 devtoolsAgent->dispatchOnInspectorBackend(message); | 395 devtoolsAgent->dispatchOnInspectorBackend(message); |
| 396 } | 396 } |
| 397 | 397 |
| 398 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) | 398 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) |
| 399 { | 399 { |
| 400 return new WebSharedWorkerImpl(client); | 400 return new WebSharedWorkerImpl(client); |
| 401 } | 401 } |
| 402 | 402 |
| 403 } // namespace blink | 403 } // namespace blink |
| OLD | NEW |