| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 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 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "web/WebViewImpl.h" | 32 #include "web/WebViewImpl.h" |
| 33 | 33 |
| 34 #include "core/CSSValueKeywords.h" | 34 #include "core/CSSValueKeywords.h" |
| 35 #include "core/HTMLNames.h" | 35 #include "core/HTMLNames.h" |
| 36 #include "core/InputTypeNames.h" | 36 #include "core/InputTypeNames.h" |
| 37 #include "core/clipboard/DataObject.h" | 37 #include "core/clipboard/DataObject.h" |
| 38 #include "core/dom/DOMNodeIds.h" |
| 38 #include "core/dom/Document.h" | 39 #include "core/dom/Document.h" |
| 39 #include "core/dom/Fullscreen.h" | 40 #include "core/dom/Fullscreen.h" |
| 40 #include "core/dom/LayoutTreeBuilderTraversal.h" | 41 #include "core/dom/LayoutTreeBuilderTraversal.h" |
| 41 #include "core/dom/Text.h" | 42 #include "core/dom/Text.h" |
| 42 #include "core/editing/EditingUtilities.h" | 43 #include "core/editing/EditingUtilities.h" |
| 43 #include "core/editing/Editor.h" | 44 #include "core/editing/Editor.h" |
| 44 #include "core/editing/FrameSelection.h" | 45 #include "core/editing/FrameSelection.h" |
| 45 #include "core/editing/InputMethodController.h" | 46 #include "core/editing/InputMethodController.h" |
| 46 #include "core/editing/iterators/TextIterator.h" | 47 #include "core/editing/iterators/TextIterator.h" |
| 47 #include "core/editing/markers/DocumentMarkerController.h" | 48 #include "core/editing/markers/DocumentMarkerController.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 #include "core/page/Page.h" | 87 #include "core/page/Page.h" |
| 87 #include "core/page/PagePopupClient.h" | 88 #include "core/page/PagePopupClient.h" |
| 88 #include "core/page/PointerLockController.h" | 89 #include "core/page/PointerLockController.h" |
| 89 #include "core/page/ScopedPageLoadDeferrer.h" | 90 #include "core/page/ScopedPageLoadDeferrer.h" |
| 90 #include "core/page/TouchDisambiguation.h" | 91 #include "core/page/TouchDisambiguation.h" |
| 91 #include "core/paint/PaintLayer.h" | 92 #include "core/paint/PaintLayer.h" |
| 92 #include "core/timing/DOMWindowPerformance.h" | 93 #include "core/timing/DOMWindowPerformance.h" |
| 93 #include "core/timing/Performance.h" | 94 #include "core/timing/Performance.h" |
| 94 #include "modules/accessibility/AXObject.h" | 95 #include "modules/accessibility/AXObject.h" |
| 95 #include "modules/accessibility/AXObjectCacheImpl.h" | 96 #include "modules/accessibility/AXObjectCacheImpl.h" |
| 97 #include "modules/compositorworker/CompositorWorker.h" |
| 96 #include "modules/credentialmanager/CredentialManagerClient.h" | 98 #include "modules/credentialmanager/CredentialManagerClient.h" |
| 97 #include "modules/encryptedmedia/MediaKeysController.h" | 99 #include "modules/encryptedmedia/MediaKeysController.h" |
| 98 #include "modules/storage/StorageNamespaceController.h" | 100 #include "modules/storage/StorageNamespaceController.h" |
| 99 #include "modules/webgl/WebGLRenderingContext.h" | 101 #include "modules/webgl/WebGLRenderingContext.h" |
| 100 #include "platform/ContextMenu.h" | 102 #include "platform/ContextMenu.h" |
| 101 #include "platform/ContextMenuItem.h" | 103 #include "platform/ContextMenuItem.h" |
| 102 #include "platform/Cursor.h" | 104 #include "platform/Cursor.h" |
| 103 #include "platform/KeyboardCodes.h" | 105 #include "platform/KeyboardCodes.h" |
| 104 #include "platform/Logging.h" | 106 #include "platform/Logging.h" |
| 105 #include "platform/NotImplemented.h" | 107 #include "platform/NotImplemented.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 121 #include "platform/scroll/ScrollbarTheme.h" | 123 #include "platform/scroll/ScrollbarTheme.h" |
| 122 #include "platform/weborigin/SchemeRegistry.h" | 124 #include "platform/weborigin/SchemeRegistry.h" |
| 123 #include "public/platform/Platform.h" | 125 #include "public/platform/Platform.h" |
| 124 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h" | 126 #include "public/platform/WebCompositeAndReadbackAsyncCallback.h" |
| 125 #include "public/platform/WebCompositorSupport.h" | 127 #include "public/platform/WebCompositorSupport.h" |
| 126 #include "public/platform/WebDragData.h" | 128 #include "public/platform/WebDragData.h" |
| 127 #include "public/platform/WebFloatPoint.h" | 129 #include "public/platform/WebFloatPoint.h" |
| 128 #include "public/platform/WebGestureCurve.h" | 130 #include "public/platform/WebGestureCurve.h" |
| 129 #include "public/platform/WebImage.h" | 131 #include "public/platform/WebImage.h" |
| 130 #include "public/platform/WebLayerTreeView.h" | 132 #include "public/platform/WebLayerTreeView.h" |
| 133 #include "public/platform/WebMutation.h" |
| 131 #include "public/platform/WebURLRequest.h" | 134 #include "public/platform/WebURLRequest.h" |
| 132 #include "public/platform/WebVector.h" | 135 #include "public/platform/WebVector.h" |
| 133 #include "public/platform/WebViewScheduler.h" | 136 #include "public/platform/WebViewScheduler.h" |
| 134 #include "public/web/WebAXObject.h" | 137 #include "public/web/WebAXObject.h" |
| 135 #include "public/web/WebActiveWheelFlingParameters.h" | 138 #include "public/web/WebActiveWheelFlingParameters.h" |
| 136 #include "public/web/WebAutofillClient.h" | 139 #include "public/web/WebAutofillClient.h" |
| 137 #include "public/web/WebElement.h" | 140 #include "public/web/WebElement.h" |
| 138 #include "public/web/WebFrame.h" | 141 #include "public/web/WebFrame.h" |
| 139 #include "public/web/WebFrameClient.h" | 142 #include "public/web/WebFrameClient.h" |
| 140 #include "public/web/WebHitTestResult.h" | 143 #include "public/web/WebHitTestResult.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 162 #include "web/PrerendererClientImpl.h" | 165 #include "web/PrerendererClientImpl.h" |
| 163 #include "web/ResizeViewportAnchor.h" | 166 #include "web/ResizeViewportAnchor.h" |
| 164 #include "web/RotationViewportAnchor.h" | 167 #include "web/RotationViewportAnchor.h" |
| 165 #include "web/SpeechRecognitionClientProxy.h" | 168 #include "web/SpeechRecognitionClientProxy.h" |
| 166 #include "web/StorageQuotaClientImpl.h" | 169 #include "web/StorageQuotaClientImpl.h" |
| 167 #include "web/ValidationMessageClientImpl.h" | 170 #include "web/ValidationMessageClientImpl.h" |
| 168 #include "web/ViewportAnchor.h" | 171 #include "web/ViewportAnchor.h" |
| 169 #include "web/WebDevToolsAgentImpl.h" | 172 #include "web/WebDevToolsAgentImpl.h" |
| 170 #include "web/WebInputEventConversion.h" | 173 #include "web/WebInputEventConversion.h" |
| 171 #include "web/WebLocalFrameImpl.h" | 174 #include "web/WebLocalFrameImpl.h" |
| 175 #include "web/WebMutatorImpl.h" |
| 172 #include "web/WebPagePopupImpl.h" | 176 #include "web/WebPagePopupImpl.h" |
| 173 #include "web/WebPluginContainerImpl.h" | 177 #include "web/WebPluginContainerImpl.h" |
| 174 #include "web/WebRemoteFrameImpl.h" | 178 #include "web/WebRemoteFrameImpl.h" |
| 175 #include "web/WebSettingsImpl.h" | 179 #include "web/WebSettingsImpl.h" |
| 176 #include "web/WorkerGlobalScopeProxyProviderImpl.h" | 180 #include "web/WorkerGlobalScopeProxyProviderImpl.h" |
| 177 #include "wtf/CurrentTime.h" | 181 #include "wtf/CurrentTime.h" |
| 178 #include "wtf/RefPtr.h" | 182 #include "wtf/RefPtr.h" |
| 179 #include "wtf/TemporaryChange.h" | 183 #include "wtf/TemporaryChange.h" |
| 180 | 184 |
| 181 #if USE(DEFAULT_RENDER_THEME) | 185 #if USE(DEFAULT_RENDER_THEME) |
| (...skipping 4246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4428 blink::DOMWindow* domWindow = frame->domWindow(); | 4432 blink::DOMWindow* domWindow = frame->domWindow(); |
| 4429 blink::Performance* performance = DOMWindowPerformance::performance(*domWind
ow); | 4433 blink::Performance* performance = DOMWindowPerformance::performance(*domWind
ow); |
| 4430 for (size_t i = 0; i < events.size(); ++i) { | 4434 for (size_t i = 0; i < events.size(); ++i) { |
| 4431 if (eventType == CompositeEvent) | 4435 if (eventType == CompositeEvent) |
| 4432 performance->addCompositeTiming(domWindow->document(), events[i].sou
rceFrame, events[i].startTime); | 4436 performance->addCompositeTiming(domWindow->document(), events[i].sou
rceFrame, events[i].startTime); |
| 4433 else if (eventType == RenderEvent) | 4437 else if (eventType == RenderEvent) |
| 4434 performance->addRenderTiming(domWindow->document(), events[i].source
Frame, events[i].startTime, events[i].finishTime); | 4438 performance->addRenderTiming(domWindow->document(), events[i].source
Frame, events[i].startTime, events[i].finishTime); |
| 4435 } | 4439 } |
| 4436 } | 4440 } |
| 4437 | 4441 |
| 4442 void WebViewImpl::applyMutations(const WebMutationMap& mutations) |
| 4443 { |
| 4444 TRACE_EVENT0("compositor-worker", "WebViewImpl::applyMutations"); |
| 4445 for (const auto& pair : mutations) { |
| 4446 int elementId = pair.first; |
| 4447 const WebMutation& mutation = pair.second; |
| 4448 Node* node = DOMNodeIds::nodeForId(elementId); |
| 4449 if (!node || !toElement(node)) |
| 4450 continue; |
| 4451 toElement(node)->updateFromMutation(mutation); |
| 4452 } |
| 4453 } |
| 4454 |
| 4438 void WebViewImpl::updateLayerTreeViewport() | 4455 void WebViewImpl::updateLayerTreeViewport() |
| 4439 { | 4456 { |
| 4440 if (!page() || !m_layerTreeView) | 4457 if (!page() || !m_layerTreeView) |
| 4441 return; | 4458 return; |
| 4442 | 4459 |
| 4443 m_layerTreeView->setPageScaleFactorAndLimits(pageScaleFactor(), minimumPageS
caleFactor(), maximumPageScaleFactor()); | 4460 m_layerTreeView->setPageScaleFactorAndLimits(pageScaleFactor(), minimumPageS
caleFactor(), maximumPageScaleFactor()); |
| 4444 } | 4461 } |
| 4445 | 4462 |
| 4446 void WebViewImpl::updateLayerTreeBackgroundColor() | 4463 void WebViewImpl::updateLayerTreeBackgroundColor() |
| 4447 { | 4464 { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4571 void WebViewImpl::forceNextWebGLContextCreationToFail() | 4588 void WebViewImpl::forceNextWebGLContextCreationToFail() |
| 4572 { | 4589 { |
| 4573 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); | 4590 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); |
| 4574 } | 4591 } |
| 4575 | 4592 |
| 4576 void WebViewImpl::forceNextDrawingBufferCreationToFail() | 4593 void WebViewImpl::forceNextDrawingBufferCreationToFail() |
| 4577 { | 4594 { |
| 4578 DrawingBuffer::forceNextDrawingBufferCreationToFail(); | 4595 DrawingBuffer::forceNextDrawingBufferCreationToFail(); |
| 4579 } | 4596 } |
| 4580 | 4597 |
| 4598 CompositorProxyClient* WebViewImpl::createCompositorProxyClient() |
| 4599 { |
| 4600 if (!m_mutator.get()) { |
| 4601 m_mutator = WebMutatorImpl::create(); |
| 4602 m_layerTreeView->setMutatorClient(m_mutator->client()); |
| 4603 } |
| 4604 return m_mutator->createCompositorProxyClient(); |
| 4605 } |
| 4606 |
| 4607 void WebViewImpl::schedulePostCommitTask(PassOwnPtr<Closure> task) |
| 4608 { |
| 4609 TRACE_EVENT0("compositor-worker", "WebViewImpl::schedulePostCommitTask"); |
| 4610 m_postCommitTasks.append(task); |
| 4611 } |
| 4612 |
| 4613 void WebViewImpl::didCommit() |
| 4614 { |
| 4615 TRACE_EVENT1("compositor-worker", "WebViewImpl::didCommit", "num_tasks", sta
tic_cast<int>(m_postCommitTasks.size())); |
| 4616 while (!m_postCommitTasks.isEmpty()) { |
| 4617 (*m_postCommitTasks.last())(); |
| 4618 m_postCommitTasks.removeLast(); |
| 4619 } |
| 4620 } |
| 4621 |
| 4581 void WebViewImpl::updatePageOverlays() | 4622 void WebViewImpl::updatePageOverlays() |
| 4582 { | 4623 { |
| 4583 if (m_pageColorOverlay) | 4624 if (m_pageColorOverlay) |
| 4584 m_pageColorOverlay->update(); | 4625 m_pageColorOverlay->update(); |
| 4585 if (InspectorOverlay* overlay = inspectorOverlay()) { | 4626 if (InspectorOverlay* overlay = inspectorOverlay()) { |
| 4586 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); | 4627 PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); |
| 4587 if (inspectorPageOverlay) | 4628 if (inspectorPageOverlay) |
| 4588 inspectorPageOverlay->update(); | 4629 inspectorPageOverlay->update(); |
| 4589 } | 4630 } |
| 4590 } | 4631 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 4615 void WebViewImpl::detachPaintArtifactCompositor() | 4656 void WebViewImpl::detachPaintArtifactCompositor() |
| 4616 { | 4657 { |
| 4617 if (!m_layerTreeView) | 4658 if (!m_layerTreeView) |
| 4618 return; | 4659 return; |
| 4619 | 4660 |
| 4620 m_layerTreeView->setDeferCommits(true); | 4661 m_layerTreeView->setDeferCommits(true); |
| 4621 m_layerTreeView->clearRootLayer(); | 4662 m_layerTreeView->clearRootLayer(); |
| 4622 } | 4663 } |
| 4623 | 4664 |
| 4624 } // namespace blink | 4665 } // namespace blink |
| OLD | NEW |