aw: Set FullscreenView initial size

This fixes momentarily sending 0x0 size down into content before the
FullscreenView is layed out. The 0x0 size sometimes cause issues and is
generally unexpected in chromium code, so best to avoid it.

Bug: 953868
Change-Id: Ib81707ccb6fc126c714342e6c45c336855d4424b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1584469
Reviewed-by: Tobias Sargeant <tobiasjs@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654240}
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index 3e62280..87de557 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -993,7 +993,8 @@
 
         // In fullscreen mode FullScreenView owns the AwViewMethodsImpl and AwContents
         // a NullAwViewMethods.
-        FullScreenView fullScreenView = new FullScreenView(mContext, mAwViewMethods, this);
+        FullScreenView fullScreenView = new FullScreenView(mContext, mAwViewMethods, this,
+                mContainerView.getWidth(), mContainerView.getHeight());
         fullScreenView.setFocusable(true);
         fullScreenView.setFocusableInTouchMode(true);
         boolean wasInitialContainerViewFocused = mContainerView.isFocused();
diff --git a/android_webview/java/src/org/chromium/android_webview/FullScreenView.java b/android_webview/java/src/org/chromium/android_webview/FullScreenView.java
index 9e4962e..372b916 100644
--- a/android_webview/java/src/org/chromium/android_webview/FullScreenView.java
+++ b/android_webview/java/src/org/chromium/android_webview/FullScreenView.java
@@ -29,9 +29,11 @@
     private final AwContents mAwContents;
     private InternalAccessAdapter mInternalAccessAdapter;
 
-    public FullScreenView(Context context, AwViewMethods awViewMethods,
-            AwContents awContents) {
+    public FullScreenView(Context context, AwViewMethods awViewMethods, AwContents awContents,
+            int initialWidth, int initialHeight) {
         super(context);
+        setRight(initialWidth);
+        setBottom(initialHeight);
         setAwViewMethods(awViewMethods);
         mAwContents = awContents;
         mInternalAccessAdapter = new InternalAccessAdapter();
@@ -137,7 +139,10 @@
     @Override
     public void onSizeChanged(final int w, final int h, final int ow, final int oh) {
         super.onSizeChanged(w, h, ow, oh);
-        mAwViewMethods.onSizeChanged(w, h, ow, oh);
+        // Null check for setting initial size before mAwViewMethods is set.
+        if (mAwViewMethods != null) {
+            mAwViewMethods.onSizeChanged(w, h, ow, oh);
+        }
     }
 
     @Override