• stanisc's avatar
    Migrate Extensions Store/Policy code to Task Scheduler API · 6d016c93
    stanisc authored
    This changes most of Extensions Store/Policy code to use a dedicated
    SequencedTaskRunner to post tasks rather than posting on the browser
    FILE thread.
    
    Initially I tried to keep the change limited to the sync related
    part of the Extensions code. The problem that I ran into is that
    different types of storage are handled in a generic way on the
    storage frontend (for example, all them were deleted on FILE thread).
    So once I migrated the sync storage, I had to modify other storage
    types as well. Because of that I had to access backend task
    runner singleton from extensions component so in order to satisfy
    dependencies I had to move GetBackendTaskRunner() to
    extensions/browser/api/storage.
    
    Some of the tests relied on TestBrowserThreadBundle making all
    browser threads map to the same physical thread which allowed the
    test code to satisfy DCHECK_CURRENTLY_ON(BrowserThread::FILE) check
    while running on the main test thread. With this migration that
    didn't work anymore so I had to modify ExtensionSettingSyncTest and
    PolicyValueStoreTest tests to actually post API calls on the right
    sequence. That was the most difficult part of this change.
    Other than that the rest of the changes should be straightforward.
    
    BUG=689520
    
    Review-Url: https://codereview.chromium.org/2965153002
    Cr-Commit-Position: refs/heads/master@{#486250}
    6d016c93
BUILD.gn 46.7 KB