Commit 486a0354 authored by edchin's avatar edchin Committed by Commit Bot

[ios] Remove stale image if snapshotting failed

This CL works towards reducing duplicate code in snapshot_generator.mm.
An improvement made in an earlier CL was only made to web view snapshots
and not to native views. This CL fixes native view snapshots.

Bug: 918032
Change-Id: I37d0a9bdead31ccce8e467846c2927105c0a76c7
Reviewed-on: https://chromium-review.googlesource.com/c/1395878Reviewed-by: default avataredchin <edchin@chromium.org>
Reviewed-by: default avatarJustin Cohen <justincohen@chromium.org>
Commit-Queue: edchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#619972}
parent 0a51bbb5
...@@ -116,9 +116,7 @@ BOOL ViewHierarchyContainsWKWebView(UIView* view) { ...@@ -116,9 +116,7 @@ BOOL ViewHierarchyContainsWKWebView(UIView* view) {
- (UIImage*)updateSnapshot { - (UIImage*)updateSnapshot {
UIImage* snapshot = [self generateSnapshotWithOverlays:YES]; UIImage* snapshot = [self generateSnapshotWithOverlays:YES];
if (snapshot) { [self updateSnapshotCacheWithImage:snapshot];
[self.snapshotCache setImage:snapshot withSessionID:self.sessionID];
}
return snapshot; return snapshot;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment