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

Unified Diff: ui/keyboard/content/keyboard_ui_content.cc

Issue 2322513002: Check for null return from GetNativeView(). (Closed)
Patch Set: Upload version that includes early out in UpdateInsets. 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
« 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: ui/keyboard/content/keyboard_ui_content.cc
diff --git a/ui/keyboard/content/keyboard_ui_content.cc b/ui/keyboard/content/keyboard_ui_content.cc
index cd6a2ab3a753c11ec8bfc8623193d8aea9913324..e609e58c2673097f223bdec9beb204d649638b33 100644
--- a/ui/keyboard/content/keyboard_ui_content.cc
+++ b/ui/keyboard/content/keyboard_ui_content.cc
@@ -161,6 +161,12 @@ void KeyboardUIContent::LoadSystemKeyboard() {
}
void KeyboardUIContent::UpdateInsetsForWindow(aura::Window* window) {
+ // Added while we determine if RenderWidgetHostViewChildFrame can be
+ // changed to always return a non-null value: https://crbug.com/644726 .
+ // If we cannot guarantee a non-null value, then this may need to stay.
+ if (!window)
+ return;
Charlie Reis 2016/09/07 20:27:16 I think we probably shouldn't include this change.
wjmaclean 2016/09/07 20:40:57 Done.
+
aura::Window* keyboard_container =
keyboard_controller()->GetContainerWindow();
if (!ShouldWindowOverscroll(window))
@@ -238,6 +244,12 @@ void KeyboardUIContent::InitInsets(const gfx::Rect& new_bounds) {
// the render process crashed.
if (view) {
aura::Window* window = view->GetNativeView();
+ // Added while we determine if RenderWidgetHostViewChildFrame can be
+ // changed to always return a non-null value: https://crbug.com/644726 .
+ // If we cannot guarantee a non-null value, then this may need to stay.
+ if (!window)
+ return;
Charlie Reis 2016/09/07 20:27:16 This needs to be a continue and not an early retur
wjmaclean 2016/09/07 20:40:57 Ooops, I saw the enclosing if() but missed the whi
+
if (ShouldWindowOverscroll(window)) {
gfx::Rect window_bounds = window->GetBoundsInScreen();
gfx::Rect intersect = gfx::IntersectRects(window_bounds,
« 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