commit | 7390024923140a7671b1841b3565c927504b83f3 | [log] [tgz] |
---|---|---|
author | Sorin Jianu <[email protected]> | Fri Aug 17 01:11:53 2018 |
committer | Commit Bot <[email protected]> | Fri Aug 17 01:11:53 2018 |
tree | 4a3bb5c410871448a95fcf8a25ff960faee032a1 | |
parent | effddeb09d8b3bfe29e18d09a95a7798c77cb665 [diff] [blame] |
Make CrxComponent an optional member in the CrxUpdateItem. Since the instance of CrxComponent is provided by the clients of the update_client::UpdateClient, it is possible that instance is missing in some cases, such as when a CRX is uninstalled. That leads to corner cases such as calls to UpdateClient::GetCrxUpdateState returning an error, because an instance of CrxUpdateItem could not be returned. This is a mechanical change to replace the std::unique_ptr wrapper of the CrxComponent with a base::Optional wrapper, so that CrxUpdateItem could have correct value semantics. BUG=869663 Change-Id: I6aa805c2784af5ed959c8777f724322763404cb0 Reviewed-on: https://chromium-review.googlesource.com/1173018 Commit-Queue: Sorin Jianu <[email protected]> Reviewed-by: Tommy Li <[email protected]> Reviewed-by: Joshua Pawlicki <[email protected]> Reviewed-by: Minh Nguyen <[email protected]> Cr-Commit-Position: refs/heads/master@{#583913}
diff --git a/components/update_client/component.cc b/components/update_client/component.cc index aba3bff..9ca75b69 100644 --- a/components/update_client/component.cc +++ b/components/update_client/component.cc
@@ -256,7 +256,7 @@ DCHECK_EQ(ComponentState::kNew, state()); - crx_component_ = std::make_unique<CrxComponent>(); + crx_component_ = CrxComponent(); crx_component_->version = version; previous_version_ = version;