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

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

Issue 2369613003: Require WebLocalFrame to be created with a non-null client (Closed)
Patch Set: oops Created 4 years, 3 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
Index: third_party/WebKit/Source/web/ChromeClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.cpp b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
index 17c5196c58af0da104f2b2db6c66d934216c04b5..f28521197e3537525b78dc6acf7cb4b530d1fb58 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -1131,11 +1131,9 @@ void ChromeClientImpl::installSupplements(LocalFrame& frame)
{
WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(&frame);
WebFrameClient* client = webFrame->client();
esprehn 2016/09/29 04:28:42 we should make client() return a reference
dcheng 2016/09/29 04:42:38 Unfortunately, that's not easy, because it can leg
- if (client) {
- providePushControllerTo(frame, client->pushClient());
- provideUserMediaTo(frame, UserMediaClientImpl::create(client->userMediaClient()));
- }
-
+ DCHECK(client);
dcheng 2016/09/29 04:13:27 The main goal of this patch is to remove these str
+ providePushControllerTo(frame, client->pushClient());
+ provideUserMediaTo(frame, UserMediaClientImpl::create(client->userMediaClient()));
provideIndexedDBClientTo(frame, IndexedDBClientImpl::create());
provideLocalFileSystemTo(frame, LocalFileSystemClient::create());
provideNavigatorContentUtilsTo(frame, NavigatorContentUtilsClientImpl::create(webFrame));
@@ -1145,15 +1143,15 @@ void ChromeClientImpl::installSupplements(LocalFrame& frame)
enableWebBluetooth = true;
#endif
if (enableWebBluetooth)
- BluetoothSupplement::provideTo(frame, client ? client->bluetooth() : nullptr);
+ BluetoothSupplement::provideTo(frame, client->bluetooth());
- ScreenOrientationController::provideTo(frame, client ? client->webScreenOrientationClient() : nullptr);
+ ScreenOrientationController::provideTo(frame, client->webScreenOrientationClient());
if (RuntimeEnabledFeatures::presentationEnabled())
- PresentationController::provideTo(frame, client ? client->presentationClient() : nullptr);
+ PresentationController::provideTo(frame, client->presentationClient());
if (RuntimeEnabledFeatures::audioOutputDevicesEnabled())
provideAudioOutputDeviceClientTo(frame, AudioOutputDeviceClientImpl::create());
if (RuntimeEnabledFeatures::installedAppEnabled())
- InstalledAppController::provideTo(frame, client ? client->installedAppClient() : nullptr);
+ InstalledAppController::provideTo(frame, client->installedAppClient());
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698