File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change 4646#include " components/prefs/pref_registry_simple.h"
4747#include " components/prefs/pref_service.h"
4848#include " components/prefs/pref_service_factory.h"
49- #include " components/services/storage/public/mojom/local_storage_control.mojom.h"
5049#include " components/variations/pref_names.h"
5150#include " components/variations/service/variations_service.h"
5251#include " content/public/browser/browser_thread.h"
@@ -379,12 +378,11 @@ void CobaltContentBrowserClient::FlushCookiesAndLocalStorage(
379378 CHECK (rfh);
380379 auto * storage_partition = rfh->GetStoragePartition ();
381380 CHECK (storage_partition);
381+ // Flushes localStorage.
382+ storage_partition->Flush ();
382383 auto * cookie_manager = storage_partition->GetCookieManagerForBrowserProcess ();
383384 CHECK (cookie_manager);
384- auto flush_cookies =
385- base::BindOnce (&network::mojom::CookieManager::FlushCookieStore,
386- base::Unretained (cookie_manager), std::move (callback));
387- storage_partition->GetLocalStorageControl ()->Flush (std::move (flush_cookies));
385+ cookie_manager->FlushCookieStore (std::move (callback));
388386}
389387
390388void CobaltContentBrowserClient::SetUpCobaltFeaturesAndParams (
Original file line number Diff line number Diff line change 1818#include " base/functional/callback.h"
1919#include " base/notreached.h"
2020#include " build/build_config.h"
21- #include " components/services/storage/public/mojom/local_storage_control.mojom.h"
2221#include " content/public/browser/storage_partition.h"
2322#include " services/network/public/mojom/cookie_manager.mojom.h"
2423
@@ -209,14 +208,13 @@ void H5vccSystemImpl::Exit() {
209208 // and in platform-specific lifecycle handlers.
210209 auto * storage_partition = render_frame_host ().GetStoragePartition ();
211210 CHECK (storage_partition);
211+ // Flushes localStorage.
212+ storage_partition->Flush ();
212213 auto * cookie_manager = storage_partition->GetCookieManagerForBrowserProcess ();
213214 CHECK (cookie_manager);
214- auto flush_cookies = base::BindOnce (
215- &network::mojom::CookieManager::FlushCookieStore,
216- base::Unretained (cookie_manager), base::BindOnce (&PerformExitStrategy));
217215 // Sequencing exit strategy after flushing delays performing exit strategy by
218216 // 20ms when tested on a chromecast.
219- storage_partition-> GetLocalStorageControl ()-> Flush ( std::move (flush_cookies ));
217+ cookie_manager-> FlushCookieStore ( base::BindOnce (&PerformExitStrategy ));
220218}
221219
222220} // namespace h5vcc_system
You can’t perform that action at this time.
0 commit comments