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

Side by Side 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, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1123 } 1123 }
1124 1124
1125 double ChromeClientImpl::lastFrameTimeMonotonic() const 1125 double ChromeClientImpl::lastFrameTimeMonotonic() const
1126 { 1126 {
1127 return m_webView->lastFrameTimeMonotonic(); 1127 return m_webView->lastFrameTimeMonotonic();
1128 } 1128 }
1129 1129
1130 void ChromeClientImpl::installSupplements(LocalFrame& frame) 1130 void ChromeClientImpl::installSupplements(LocalFrame& frame)
1131 { 1131 {
1132 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(&frame); 1132 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(&frame);
1133 WebFrameClient* client = webFrame->client(); 1133 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
1134 if (client) { 1134 DCHECK(client);
dcheng 2016/09/29 04:13:27 The main goal of this patch is to remove these str
1135 providePushControllerTo(frame, client->pushClient()); 1135 providePushControllerTo(frame, client->pushClient());
1136 provideUserMediaTo(frame, UserMediaClientImpl::create(client->userMediaC lient())); 1136 provideUserMediaTo(frame, UserMediaClientImpl::create(client->userMediaClien t()));
1137 }
1138
1139 provideIndexedDBClientTo(frame, IndexedDBClientImpl::create()); 1137 provideIndexedDBClientTo(frame, IndexedDBClientImpl::create());
1140 provideLocalFileSystemTo(frame, LocalFileSystemClient::create()); 1138 provideLocalFileSystemTo(frame, LocalFileSystemClient::create());
1141 provideNavigatorContentUtilsTo(frame, NavigatorContentUtilsClientImpl::creat e(webFrame)); 1139 provideNavigatorContentUtilsTo(frame, NavigatorContentUtilsClientImpl::creat e(webFrame));
1142 1140
1143 bool enableWebBluetooth = RuntimeEnabledFeatures::webBluetoothEnabled(); 1141 bool enableWebBluetooth = RuntimeEnabledFeatures::webBluetoothEnabled();
1144 #if OS(CHROMEOS) || OS(ANDROID) || OS(MACOSX) 1142 #if OS(CHROMEOS) || OS(ANDROID) || OS(MACOSX)
1145 enableWebBluetooth = true; 1143 enableWebBluetooth = true;
1146 #endif 1144 #endif
1147 if (enableWebBluetooth) 1145 if (enableWebBluetooth)
1148 BluetoothSupplement::provideTo(frame, client ? client->bluetooth() : nul lptr); 1146 BluetoothSupplement::provideTo(frame, client->bluetooth());
1149 1147
1150 ScreenOrientationController::provideTo(frame, client ? client->webScreenOrie ntationClient() : nullptr); 1148 ScreenOrientationController::provideTo(frame, client->webScreenOrientationCl ient());
1151 if (RuntimeEnabledFeatures::presentationEnabled()) 1149 if (RuntimeEnabledFeatures::presentationEnabled())
1152 PresentationController::provideTo(frame, client ? client->presentationCl ient() : nullptr); 1150 PresentationController::provideTo(frame, client->presentationClient());
1153 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled()) 1151 if (RuntimeEnabledFeatures::audioOutputDevicesEnabled())
1154 provideAudioOutputDeviceClientTo(frame, AudioOutputDeviceClientImpl::cre ate()); 1152 provideAudioOutputDeviceClientTo(frame, AudioOutputDeviceClientImpl::cre ate());
1155 if (RuntimeEnabledFeatures::installedAppEnabled()) 1153 if (RuntimeEnabledFeatures::installedAppEnabled())
1156 InstalledAppController::provideTo(frame, client ? client->installedAppCl ient() : nullptr); 1154 InstalledAppController::provideTo(frame, client->installedAppClient());
1157 } 1155 }
1158 1156
1159 } // namespace blink 1157 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698