[Nav Experiment] Restore session history after reenable web usage.

The last use case of SetWebUsageEnabled(false) is to clear visited site
data. It does so by removing the WKWebView due to a bug in WebKit (see
crbug.com/557963). This breaks in WKBasedNavigationManager because it
relies on WKWebView as the source of truth for session history.

This CL fixes the issue by temporarily caching the session history in
WebState and restoring it into the navigation manager when web usage is
re-enabled.

This fixes the LoadIfNecessaryTest.DisableAndReenableWebUsage test.

Bug: 781916
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I6f7db84504603e624f5befa66ccb41c10433dd69
Reviewed-on: https://chromium-review.googlesource.com/789791
Commit-Queue: Danyao Wang <danyao@chromium.org>
Reviewed-by: Eugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519458}
2 files changed