| 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 #include "core/page/Page.h" | 149 #include "core/page/Page.h" |
| 150 #include "core/page/PrintContext.h" | 150 #include "core/page/PrintContext.h" |
| 151 #include "core/paint/PaintLayer.h" | 151 #include "core/paint/PaintLayer.h" |
| 152 #include "core/paint/ScopeRecorder.h" | 152 #include "core/paint/ScopeRecorder.h" |
| 153 #include "core/paint/TransformRecorder.h" | 153 #include "core/paint/TransformRecorder.h" |
| 154 #include "core/timing/DOMWindowPerformance.h" | 154 #include "core/timing/DOMWindowPerformance.h" |
| 155 #include "core/timing/Performance.h" | 155 #include "core/timing/Performance.h" |
| 156 #include "modules/app_banner/AppBannerController.h" | 156 #include "modules/app_banner/AppBannerController.h" |
| 157 #include "modules/audio_output_devices/AudioOutputDeviceClient.h" | 157 #include "modules/audio_output_devices/AudioOutputDeviceClient.h" |
| 158 #include "modules/bluetooth/BluetoothSupplement.h" | 158 #include "modules/bluetooth/BluetoothSupplement.h" |
| 159 #include "modules/geolocation/GeolocationController.h" | |
| 160 #include "modules/installedapp/InstalledAppController.h" | 159 #include "modules/installedapp/InstalledAppController.h" |
| 161 #include "modules/notifications/NotificationPermissionClient.h" | 160 #include "modules/notifications/NotificationPermissionClient.h" |
| 162 #include "modules/permissions/PermissionController.h" | 161 #include "modules/permissions/PermissionController.h" |
| 163 #include "modules/presentation/PresentationController.h" | 162 #include "modules/presentation/PresentationController.h" |
| 164 #include "modules/push_messaging/PushController.h" | 163 #include "modules/push_messaging/PushController.h" |
| 165 #include "modules/screen_orientation/ScreenOrientationController.h" | 164 #include "modules/screen_orientation/ScreenOrientationController.h" |
| 166 #include "modules/vr/VRController.h" | 165 #include "modules/vr/VRController.h" |
| 167 #include "modules/wake_lock/ScreenWakeLock.h" | 166 #include "modules/wake_lock/ScreenWakeLock.h" |
| 168 #include "platform/ScriptForbiddenScope.h" | 167 #include "platform/ScriptForbiddenScope.h" |
| 169 #include "platform/TraceEvent.h" | 168 #include "platform/TraceEvent.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 #include "public/web/WebPrintPresetOptions.h" | 212 #include "public/web/WebPrintPresetOptions.h" |
| 214 #include "public/web/WebRange.h" | 213 #include "public/web/WebRange.h" |
| 215 #include "public/web/WebScriptSource.h" | 214 #include "public/web/WebScriptSource.h" |
| 216 #include "public/web/WebSerializedScriptValue.h" | 215 #include "public/web/WebSerializedScriptValue.h" |
| 217 #include "public/web/WebTreeScopeType.h" | 216 #include "public/web/WebTreeScopeType.h" |
| 218 #include "skia/ext/platform_canvas.h" | 217 #include "skia/ext/platform_canvas.h" |
| 219 #include "web/AssociatedURLLoader.h" | 218 #include "web/AssociatedURLLoader.h" |
| 220 #include "web/AudioOutputDeviceClientImpl.h" | 219 #include "web/AudioOutputDeviceClientImpl.h" |
| 221 #include "web/CompositionUnderlineVectorBuilder.h" | 220 #include "web/CompositionUnderlineVectorBuilder.h" |
| 222 #include "web/FindInPageCoordinates.h" | 221 #include "web/FindInPageCoordinates.h" |
| 223 #include "web/GeolocationClientProxy.h" | |
| 224 #include "web/IndexedDBClientImpl.h" | 222 #include "web/IndexedDBClientImpl.h" |
| 225 #include "web/LocalFileSystemClient.h" | 223 #include "web/LocalFileSystemClient.h" |
| 226 #include "web/MIDIClientProxy.h" | 224 #include "web/MIDIClientProxy.h" |
| 227 #include "web/NavigatorContentUtilsClientImpl.h" | 225 #include "web/NavigatorContentUtilsClientImpl.h" |
| 228 #include "web/NotificationPermissionClientImpl.h" | 226 #include "web/NotificationPermissionClientImpl.h" |
| 229 #include "web/RemoteFrameOwner.h" | 227 #include "web/RemoteFrameOwner.h" |
| 230 #include "web/SharedWorkerRepositoryClientImpl.h" | 228 #include "web/SharedWorkerRepositoryClientImpl.h" |
| 231 #include "web/SuspendableScriptExecutor.h" | 229 #include "web/SuspendableScriptExecutor.h" |
| 232 #include "web/TextFinder.h" | 230 #include "web/TextFinder.h" |
| 233 #include "web/WebDataSourceImpl.h" | 231 #include "web/WebDataSourceImpl.h" |
| (...skipping 1179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1413 | 1411 |
| 1414 WebLocalFrameImpl::WebLocalFrameImpl(WebTreeScopeType scope, WebFrameClient* cli
ent) | 1412 WebLocalFrameImpl::WebLocalFrameImpl(WebTreeScopeType scope, WebFrameClient* cli
ent) |
| 1415 : WebLocalFrame(scope) | 1413 : WebLocalFrame(scope) |
| 1416 , m_frameLoaderClientImpl(FrameLoaderClientImpl::create(this)) | 1414 , m_frameLoaderClientImpl(FrameLoaderClientImpl::create(this)) |
| 1417 , m_frameWidget(0) | 1415 , m_frameWidget(0) |
| 1418 , m_client(client) | 1416 , m_client(client) |
| 1419 , m_autofillClient(0) | 1417 , m_autofillClient(0) |
| 1420 , m_contentSettingsClient(0) | 1418 , m_contentSettingsClient(0) |
| 1421 , m_inputEventsScaleFactorForEmulation(1) | 1419 , m_inputEventsScaleFactorForEmulation(1) |
| 1422 , m_userMediaClientImpl(this) | 1420 , m_userMediaClientImpl(this) |
| 1423 , m_geolocationClientProxy(GeolocationClientProxy::create(client ? client->g
eolocationClient() : 0)) | |
| 1424 , m_webDevToolsFrontend(0) | 1421 , m_webDevToolsFrontend(0) |
| 1425 , m_selfKeepAlive(this) | 1422 , m_selfKeepAlive(this) |
| 1426 { | 1423 { |
| 1427 frameCount++; | 1424 frameCount++; |
| 1428 } | 1425 } |
| 1429 | 1426 |
| 1430 WebLocalFrameImpl::WebLocalFrameImpl(WebRemoteFrame* oldWebFrame, WebFrameClient
* client) | 1427 WebLocalFrameImpl::WebLocalFrameImpl(WebRemoteFrame* oldWebFrame, WebFrameClient
* client) |
| 1431 : WebLocalFrameImpl(oldWebFrame->inShadowTree() ? WebTreeScopeType::Shadow :
WebTreeScopeType::Document, client) | 1428 : WebLocalFrameImpl(oldWebFrame->inShadowTree() ? WebTreeScopeType::Shadow :
WebTreeScopeType::Document, client) |
| 1432 { | 1429 { |
| 1433 } | 1430 } |
| 1434 | 1431 |
| 1435 WebLocalFrameImpl::~WebLocalFrameImpl() | 1432 WebLocalFrameImpl::~WebLocalFrameImpl() |
| 1436 { | 1433 { |
| 1437 // The widget for the frame, if any, must have already been closed. | 1434 // The widget for the frame, if any, must have already been closed. |
| 1438 DCHECK(!m_frameWidget); | 1435 DCHECK(!m_frameWidget); |
| 1439 frameCount--; | 1436 frameCount--; |
| 1440 } | 1437 } |
| 1441 | 1438 |
| 1442 DEFINE_TRACE(WebLocalFrameImpl) | 1439 DEFINE_TRACE(WebLocalFrameImpl) |
| 1443 { | 1440 { |
| 1444 visitor->trace(m_frameLoaderClientImpl); | 1441 visitor->trace(m_frameLoaderClientImpl); |
| 1445 visitor->trace(m_frame); | 1442 visitor->trace(m_frame); |
| 1446 visitor->trace(m_devToolsAgent); | 1443 visitor->trace(m_devToolsAgent); |
| 1447 visitor->trace(m_textFinder); | 1444 visitor->trace(m_textFinder); |
| 1448 visitor->trace(m_printContext); | 1445 visitor->trace(m_printContext); |
| 1449 visitor->trace(m_geolocationClientProxy); | |
| 1450 visitor->trace(m_contextMenuNode); | 1446 visitor->trace(m_contextMenuNode); |
| 1451 visitor->template registerWeakMembers<WebFrame, &WebFrame::clearWeakFrames>(
this); | 1447 visitor->template registerWeakMembers<WebFrame, &WebFrame::clearWeakFrames>(
this); |
| 1452 WebFrame::traceFrames(visitor, this); | 1448 WebFrame::traceFrames(visitor, this); |
| 1453 WebFrameImplBase::trace(visitor); | 1449 WebFrameImplBase::trace(visitor); |
| 1454 } | 1450 } |
| 1455 | 1451 |
| 1456 void WebLocalFrameImpl::setCoreFrame(LocalFrame* frame) | 1452 void WebLocalFrameImpl::setCoreFrame(LocalFrame* frame) |
| 1457 { | 1453 { |
| 1458 m_frame = frame; | 1454 m_frame = frame; |
| 1459 | 1455 |
| 1460 // FIXME: we shouldn't add overhead to every frame by registering these obje
cts when they're not used. | 1456 // FIXME: we shouldn't add overhead to every frame by registering these obje
cts when they're not used. |
| 1461 if (!m_frame) | 1457 if (!m_frame) |
| 1462 return; | 1458 return; |
| 1463 | 1459 |
| 1464 if (m_client) | 1460 if (m_client) |
| 1465 providePushControllerTo(*m_frame, m_client->pushClient()); | 1461 providePushControllerTo(*m_frame, m_client->pushClient()); |
| 1466 | 1462 |
| 1467 provideNotificationPermissionClientTo(*m_frame, NotificationPermissionClient
Impl::create()); | 1463 provideNotificationPermissionClientTo(*m_frame, NotificationPermissionClient
Impl::create()); |
| 1468 provideUserMediaTo(*m_frame, &m_userMediaClientImpl); | 1464 provideUserMediaTo(*m_frame, &m_userMediaClientImpl); |
| 1469 provideGeolocationTo(*m_frame, m_geolocationClientProxy.get()); | |
| 1470 m_geolocationClientProxy->setController(GeolocationController::from(m_frame.
get())); | |
| 1471 provideMIDITo(*m_frame, MIDIClientProxy::create(m_client ? m_client->webMIDI
Client() : nullptr)); | 1465 provideMIDITo(*m_frame, MIDIClientProxy::create(m_client ? m_client->webMIDI
Client() : nullptr)); |
| 1472 provideIndexedDBClientTo(*m_frame, IndexedDBClientImpl::create()); | 1466 provideIndexedDBClientTo(*m_frame, IndexedDBClientImpl::create()); |
| 1473 provideLocalFileSystemTo(*m_frame, LocalFileSystemClient::create()); | 1467 provideLocalFileSystemTo(*m_frame, LocalFileSystemClient::create()); |
| 1474 provideNavigatorContentUtilsTo(*m_frame, NavigatorContentUtilsClientImpl::cr
eate(this)); | 1468 provideNavigatorContentUtilsTo(*m_frame, NavigatorContentUtilsClientImpl::cr
eate(this)); |
| 1475 | 1469 |
| 1476 if (RuntimeEnabledFeatures::webBluetoothEnabled()) | 1470 if (RuntimeEnabledFeatures::webBluetoothEnabled()) |
| 1477 BluetoothSupplement::provideTo(*m_frame, m_client ? m_client->bluetooth(
) : nullptr); | 1471 BluetoothSupplement::provideTo(*m_frame, m_client ? m_client->bluetooth(
) : nullptr); |
| 1478 if (RuntimeEnabledFeatures::screenOrientationEnabled()) | 1472 if (RuntimeEnabledFeatures::screenOrientationEnabled()) |
| 1479 ScreenOrientationController::provideTo(*m_frame, m_client ? m_client->we
bScreenOrientationClient() : nullptr); | 1473 ScreenOrientationController::provideTo(*m_frame, m_client ? m_client->we
bScreenOrientationClient() : nullptr); |
| 1480 if (RuntimeEnabledFeatures::presentationEnabled()) | 1474 if (RuntimeEnabledFeatures::presentationEnabled()) |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2106 return WebSandboxFlags::None; | 2100 return WebSandboxFlags::None; |
| 2107 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); | 2101 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags(
)); |
| 2108 } | 2102 } |
| 2109 | 2103 |
| 2110 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) | 2104 void WebLocalFrameImpl::forceSandboxFlags(WebSandboxFlags flags) |
| 2111 { | 2105 { |
| 2112 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); | 2106 frame()->loader().forceSandboxFlags(static_cast<SandboxFlags>(flags)); |
| 2113 } | 2107 } |
| 2114 | 2108 |
| 2115 } // namespace blink | 2109 } // namespace blink |
| OLD | NEW |