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

Unified Diff: mash/catalog_viewer/catalog_viewer.cc

Issue 2096293002: Eliminate usage of InterfacePtr::WaitForIncomingResponse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase only Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: mash/catalog_viewer/catalog_viewer.cc
diff --git a/mash/catalog_viewer/catalog_viewer.cc b/mash/catalog_viewer/catalog_viewer.cc
index 0aa4a241fa477e579a2d1354207957f586a8b4c9..fcb162e321d18f8f4d2b2839be15c001d5e4bc85 100644
--- a/mash/catalog_viewer/catalog_viewer.cc
+++ b/mash/catalog_viewer/catalog_viewer.cc
@@ -50,12 +50,12 @@ class CatalogViewerContents : public views::WidgetDelegateView,
table_view_parent_ = table_view_->CreateParentIfNecessary();
AddChildView(table_view_parent_);
- catalog_->GetEntries(nullptr,
- base::Bind(&CatalogViewerContents::OnGotCatalogEntries,
- weak_ptr_factory_.GetWeakPtr()));
// We don't want to show an empty UI so we just block until we have all the
- // data.
- catalog_.WaitForIncomingResponse();
+ // data. GetEntries is a sync call.
+ mojo::Array<catalog::mojom::EntryPtr> entries;
+ catalog_->GetEntries(nullptr, &entries);
+
+ OnGotCatalogEntries(entries);
sky 2016/07/06 15:47:38 There is no point in OnGotCatalogEntries now. Move
yzshen1 2016/07/06 16:50:26 Not sure whether it matters, but please note that
leonhsl(Using Gerrit) 2016/07/07 07:43:12 Moved OnGotCatalogEntries() impl here.
leonhsl(Using Gerrit) 2016/07/07 07:43:12 Yeah this indeed becomes different with before.. T
}
~CatalogViewerContents() override {
table_view_->SetModel(nullptr);
@@ -117,7 +117,8 @@ class CatalogViewerContents : public views::WidgetDelegateView,
observer_ = observer;
}
- void OnGotCatalogEntries(mojo::Array<catalog::mojom::EntryPtr> entries) {
+ void OnGotCatalogEntries(
+ const mojo::Array<catalog::mojom::EntryPtr>& entries) {
entries_.clear();
for (auto& entry : entries)
entries_.push_back(Entry(entry->display_name, entry->name));

Powered by Google App Engine
This is Rietveld 408576698