[Sync] get TypedURLSyncBridge on model thread.

Comments

[Sync] get TypedURLSyncBridge on model thread.
There is a race condition between HistoryBackend::Init and
HistoryBackend::GetTypedURLSyncBridge.
HistoryService instantiate HistoryBackend first, and then schedule
HistoryBackend::Init by HistoryService::backend_task_runner_. Later on,
HistoryBackend::Init will instantiate TypedURLSyncBridge.
TypedURLModelTypeController::PostBridgeTask tried to get
TypedURLSyncBridge on UI thread, so the timing might between
HistoryBackend is instantiated, but TypedURLSyncBridge is not yet.
So the fix is that let TypedURLModelTypeController get
TypedURLSyncBridge on model thread, same as ModelTypeController.
Bug: 783746
Change-Id: I9f7e6342fcec22f6b4df3a867e8235805fc44591
Reviewed-on: https://chromium-review.googlesource.com/765093
Commit-Queue: Gang Wu <gangwu@chromium.org>
Reviewed-by: Pavel Yatsuk <pavely@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516179}

Comments

IndexedDB: Enable WASM decoding in structured cloning done when writing.
According to the IndexedDB specification, when writing a value to an
object store, keys (primary key and index keys) must be extracted from a
structured clone of the value to be written (this avoids exposing
implementation details via side-effects).
We currently do not turn on WASM module deserialization when doing the
structured clone. This went unnoticed until now because we only do the
structured clone when we need to compute keys (i.e. when writing to an
object store with a primary key or with indexes). This CL fixes the
oversight.
The WPT test passes with the "WebAssembly structured cloning support"
flag enabled.
Bug: 782633
Change-Id: I695bd51231d898139165469633c6d63ffdaae262
Reviewed-on: https://chromium-review.googlesource.com/764808
Commit-Queue: Victor Costan <pwnall@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: Daniel Murphy <dmurph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#516182}