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

Unified Diff: services/shell/public/cpp/lib/interface_registry.cc

Issue 2138263002: Revert of Move content's shell connections to the IO thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: services/shell/public/cpp/lib/interface_registry.cc
diff --git a/services/shell/public/cpp/lib/interface_registry.cc b/services/shell/public/cpp/lib/interface_registry.cc
index b585eaee26654e0908cc5ed5ded2914e38909b1d..ebfaddd35ace806392e426ee68569432371092bd 100644
--- a/services/shell/public/cpp/lib/interface_registry.cc
+++ b/services/shell/public/cpp/lib/interface_registry.cc
@@ -39,29 +39,20 @@
}
void InterfaceRegistry::PauseBinding() {
- DCHECK(!is_paused_);
- is_paused_ = true;
+ DCHECK(!pending_request_.is_pending());
+ DCHECK(binding_.is_bound());
+ pending_request_ = binding_.Unbind();
}
void InterfaceRegistry::ResumeBinding() {
- DCHECK(is_paused_);
- is_paused_ = false;
-
- while (!pending_interface_requests_.empty()) {
- auto& request = pending_interface_requests_.front();
- GetInterface(request.first, std::move(request.second));
- pending_interface_requests_.pop();
- }
+ DCHECK(pending_request_.is_pending());
+ DCHECK(!binding_.is_bound());
+ binding_.Bind(std::move(pending_request_));
}
// mojom::InterfaceProvider:
void InterfaceRegistry::GetInterface(const mojo::String& interface_name,
mojo::ScopedMessagePipeHandle handle) {
- if (is_paused_) {
- pending_interface_requests_.emplace(interface_name, std::move(handle));
- return;
- }
-
auto iter = name_to_binder_.find(interface_name);
if (iter != name_to_binder_.end()) {
iter->second->BindInterface(connection_, interface_name, std::move(handle));
@@ -70,8 +61,6 @@
<< "interface: " << interface_name << " connection_name:"
<< connection_->GetConnectionName() << " remote_name:"
<< connection_->GetRemoteIdentity().name();
- } else if (!default_binder_.is_null()) {
- default_binder_.Run(interface_name, std::move(handle));
}
}
« no previous file with comments | « services/shell/public/cpp/lib/interface_provider.cc ('k') | services/shell/public/cpp/lib/service_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698