Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: chrome/browser/extensions/api/storage/settings_apitest.cc

Issue 2769113002: [Sync] Stop accessing BrowserContextKeyedServiceFactory on non-UI thread. (Closed)
Patch Set: Rebase and removing dependent patch set. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/storage/settings_sync_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <utility> 5 #include <utility>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 106
107 void FinalReplyWhenSatisfied( 107 void FinalReplyWhenSatisfied(
108 Namespace settings_namespace, 108 Namespace settings_namespace,
109 const std::string& normal_action, 109 const std::string& normal_action,
110 const std::string& incognito_action) { 110 const std::string& incognito_action) {
111 MaybeLoadAndReplyWhenSatisfied( 111 MaybeLoadAndReplyWhenSatisfied(
112 settings_namespace, normal_action, incognito_action, NULL, true); 112 settings_namespace, normal_action, incognito_action, NULL, true);
113 } 113 }
114 114
115 syncer::SyncableService* GetSyncableService() { 115 syncer::SyncableService* GetSyncableService() {
116 return settings_sync_util::GetSyncableService(browser()->profile(), 116 return settings_sync_util::GetSyncableServiceProvider(browser()->profile(),
117 kModelType); 117 kModelType)
118 .Run()
119 .get();
118 } 120 }
119 121
120 void InitSync(syncer::SyncChangeProcessor* sync_processor) { 122 void InitSync(syncer::SyncChangeProcessor* sync_processor) {
121 base::RunLoop().RunUntilIdle(); 123 base::RunLoop().RunUntilIdle();
122 InitSyncWithSyncableService(sync_processor, GetSyncableService()); 124 InitSyncWithSyncableService(sync_processor, GetSyncableService());
123 } 125 }
124 126
125 void SendChanges(const syncer::SyncChangeList& change_list) { 127 void SendChanges(const syncer::SyncChangeList& change_list) {
126 base::RunLoop().RunUntilIdle(); 128 base::RunLoop().RunUntilIdle();
127 SendChangesToSyncableService(change_list, GetSyncableService()); 129 SendChangesToSyncableService(change_list, GetSyncableService());
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 // Disable the 'managed' namespace. 566 // Disable the 'managed' namespace.
565 StorageFrontend* frontend = StorageFrontend::Get(browser()->profile()); 567 StorageFrontend* frontend = StorageFrontend::Get(browser()->profile());
566 frontend->DisableStorageForTesting(MANAGED); 568 frontend->DisableStorageForTesting(MANAGED);
567 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); 569 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED));
568 // Now run the extension. 570 // Now run the extension.
569 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) 571 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled"))
570 << message_; 572 << message_;
571 } 573 }
572 574
573 } // namespace extensions 575 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/storage/settings_sync_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698