Add UMAs for webview creation time

Android's WebView constructor calls ensureProviderCreated() and then
mProvider.init().

In Chromium WebView, this corresponds to WebViewChromiumFactoryProvider
constructor and startChromiumLocked(), so we capture the time taken
there.

And, as noted in WebViewChromium#init(), the real initialization
(startYourEngines and thus startChromiumLocked) may be delayed until
the first View method is called and View thread can be determined,
so skip it when it hasn't started yet.

The sum of the two creation times is roughly the creation time
contributed by Chromium WebView, but with the following caveats:

1) ensureProviderCreated() may be called earlier in the constructor as
   View methods can be called in the constructor.
2) This does not capture the time taken in View constructor and View
   inflation, so this is only a portion of webview creation time.

Also, the factory initialization (the first portion) occurs only once,
while the provider initialization (the second portion) occurs every
time the app creates a webview instance.

Since the second portion takes much longer only for the first time,
I'm splitting it into 'First' and 'NonFirst'.

BUG=736545

Change-Id: I16ece2c4a1277a2489f5e8f44d157fd5cc35124d
Reviewed-on: https://chromium-review.googlesource.com/1041152
Commit-Queue: Changwan Ryu <changwan@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: Paul Miller <paulmiller@chromium.org>
Reviewed-by: Tobias Sargeant <tobiasjs@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#556937}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 38fd382af0d193193f5a3bc7f64eb1e09bd05017
2 files changed
tree: 54ec6ec0fd4b7166f97cc46b88b8d99a300ec31d
  1. java/
  2. BUILD.gn
  3. generate_resource_rewriter.gni
  4. glue.gni