Skip to content

Commit 1b12e4d

Browse files
[Android] flush local storage without callback for m138. (#7669)
LocalStorageControl.Flush() was changed to not include a callback. Issue: 371433332 Co-authored-by: Brian Ting <brianting@google.com>
1 parent d620928 commit 1b12e4d

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

cobalt/browser/cobalt_content_browser_client.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
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

390388
void CobaltContentBrowserClient::SetUpCobaltFeaturesAndParams(

cobalt/browser/h5vcc_system/h5vcc_system_impl.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
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

0 commit comments

Comments
 (0)