Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1262)

Unified Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 1811753004: Webkit/Source/web/WebLocalFrameImpl microcleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index 782c0a670ac698cd4c0de89bad20b26cdabc94cb..b9fdefc5cf29e20ac2d1ee4508ce7959bb473841 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -1524,46 +1524,45 @@ void WebLocalFrameImpl::setCoreFrame(PassRefPtrWillBeRawPtr<LocalFrame> frame)
m_frame = frame;
// FIXME: we shouldn't add overhead to every frame by registering these objects when they're not used.
- if (m_frame) {
- if (m_client)
- providePushControllerTo(*m_frame, m_client->pushClient());
-
- provideNotificationPermissionClientTo(*m_frame, NotificationPermissionClientImpl::create());
- provideUserMediaTo(*m_frame, &m_userMediaClientImpl);
- provideGeolocationTo(*m_frame, m_geolocationClientProxy.get());
- m_geolocationClientProxy->setController(GeolocationController::from(m_frame.get()));
- provideMIDITo(*m_frame, MIDIClientProxy::create(m_client ? m_client->webMIDIClient() : nullptr));
- provideLocalFileSystemTo(*m_frame, LocalFileSystemClient::create());
- provideNavigatorContentUtilsTo(*m_frame, NavigatorContentUtilsClientImpl::create(this));
-
- bool enableWebBluetooth = RuntimeEnabledFeatures::webBluetoothEnabled();
+ if (!m_frame)
+ return;
+
+ if (m_client)
+ providePushControllerTo(*m_frame, m_client->pushClient());
+
+ provideNotificationPermissionClientTo(*m_frame, NotificationPermissionClientImpl::create());
+ provideUserMediaTo(*m_frame, &m_userMediaClientImpl);
+ provideGeolocationTo(*m_frame, m_geolocationClientProxy.get());
+ m_geolocationClientProxy->setController(GeolocationController::from(m_frame.get()));
+ provideMIDITo(*m_frame, MIDIClientProxy::create(m_client ? m_client->webMIDIClient() : nullptr));
+ provideLocalFileSystemTo(*m_frame, LocalFileSystemClient::create());
+ provideNavigatorContentUtilsTo(*m_frame, NavigatorContentUtilsClientImpl::create(this));
+
+ bool enableWebBluetooth = RuntimeEnabledFeatures::webBluetoothEnabled();
#if OS(CHROMEOS) || OS(ANDROID)
// TODO(https://crbug.com/584113) Enable Web Bluetooth Experiment.
// enableWebBluetooth = true;
#endif
- if (enableWebBluetooth) {
- BluetoothSupplement::provideTo(*m_frame, m_client ? m_client->bluetooth() : nullptr);
- }
-
- if (RuntimeEnabledFeatures::screenOrientationEnabled())
- ScreenOrientationController::provideTo(*m_frame, m_client ? m_client->webScreenOrientationClient() : nullptr);
- if (RuntimeEnabledFeatures::presentationEnabled())
- PresentationController::provideTo(*m_frame, m_client ? m_client->presentationClient() : nullptr);
- if (RuntimeEnabledFeatures::permissionsEnabled())
- PermissionController::provideTo(*m_frame, m_client ? m_client->permissionClient() : nullptr);
- if (RuntimeEnabledFeatures::webUSBEnabled())
- USBController::provideTo(*m_frame, m_client ? m_client->usbClient() : nullptr);
- if (RuntimeEnabledFeatures::webVREnabled())
- VRController::provideTo(*m_frame, m_client ? m_client->webVRClient() : nullptr);
- if (RuntimeEnabledFeatures::wakeLockEnabled())
- ScreenWakeLock::provideTo(*m_frame, m_client ? m_client->wakeLockClient() : nullptr);
- if (RuntimeEnabledFeatures::audioOutputDevicesEnabled())
- provideAudioOutputDeviceClientTo(*m_frame, AudioOutputDeviceClientImpl::create());
- if (RuntimeEnabledFeatures::installedAppEnabled()) {
- InstalledAppController::provideTo(*m_frame, m_client ? m_client->installedAppClient() : nullptr);
- }
- }
+ if (enableWebBluetooth)
+ BluetoothSupplement::provideTo(*m_frame, m_client ? m_client->bluetooth() : nullptr);
+
+ if (RuntimeEnabledFeatures::screenOrientationEnabled())
+ ScreenOrientationController::provideTo(*m_frame, m_client ? m_client->webScreenOrientationClient() : nullptr);
+ if (RuntimeEnabledFeatures::presentationEnabled())
+ PresentationController::provideTo(*m_frame, m_client ? m_client->presentationClient() : nullptr);
+ if (RuntimeEnabledFeatures::permissionsEnabled())
+ PermissionController::provideTo(*m_frame, m_client ? m_client->permissionClient() : nullptr);
+ if (RuntimeEnabledFeatures::webUSBEnabled())
+ USBController::provideTo(*m_frame, m_client ? m_client->usbClient() : nullptr);
+ if (RuntimeEnabledFeatures::webVREnabled())
+ VRController::provideTo(*m_frame, m_client ? m_client->webVRClient() : nullptr);
+ if (RuntimeEnabledFeatures::wakeLockEnabled())
+ ScreenWakeLock::provideTo(*m_frame, m_client ? m_client->wakeLockClient() : nullptr);
+ if (RuntimeEnabledFeatures::audioOutputDevicesEnabled())
+ provideAudioOutputDeviceClientTo(*m_frame, AudioOutputDeviceClientImpl::create());
+ if (RuntimeEnabledFeatures::installedAppEnabled())
+ InstalledAppController::provideTo(*m_frame, m_client ? m_client->installedAppClient() : nullptr);
}
void WebLocalFrameImpl::initializeCoreFrame(FrameHost* host, FrameOwner* owner, const AtomicString& name, const AtomicString& uniqueName)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698