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

Unified Diff: content/common/service_manager/service_manager_connection_impl.cc

Issue 2802093005: Have ActiveProfilePrefService Use the Original Profile (Closed)
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/prefs/active_profile_pref_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/service_manager/service_manager_connection_impl.cc
diff --git a/content/common/service_manager/service_manager_connection_impl.cc b/content/common/service_manager/service_manager_connection_impl.cc
index ea9b4f4cc3584edf7c6eefa71c939726d8367c15..9e81238aa0a4a53a53cbf5928388dcc0a9d1c9ec 100644
--- a/content/common/service_manager/service_manager_connection_impl.cc
+++ b/content/common/service_manager/service_manager_connection_impl.cc
@@ -139,11 +139,6 @@ class ServiceManagerConnectionImpl::IOThreadContext
private:
friend class base::RefCountedThreadSafe<IOThreadContext>;
- struct PendingRequest {
- std::string service_name;
- service_manager::mojom::ServiceRequest request;
- };
-
class MessageLoopObserver : public base::MessageLoop::DestructionObserver {
public:
explicit MessageLoopObserver(base::WeakPtr<IOThreadContext> context)
@@ -261,16 +256,6 @@ class ServiceManagerConnectionImpl::IOThreadContext
DCHECK(io_thread_checker_.CalledOnValidThread());
auto result = request_handlers_.insert(std::make_pair(name, handler));
DCHECK(result.second);
- auto iter = pending_requests_.begin();
- while (iter != pending_requests_.end()) {
- if ((*iter)->service_name == name) {
- std::unique_ptr<PendingRequest> pending_request = std::move(*iter);
- iter = pending_requests_.erase(iter);
- handler.Run(std::move(pending_request->request));
- } else {
- ++iter;
- }
- }
}
/////////////////////////////////////////////////////////////////////////////
@@ -344,14 +329,8 @@ class ServiceManagerConnectionImpl::IOThreadContext
const std::string& name) override {
DCHECK(io_thread_checker_.CalledOnValidThread());
auto it = request_handlers_.find(name);
- if (it == request_handlers_.end()) {
- std::unique_ptr<PendingRequest> pending_request =
- base::MakeUnique<PendingRequest>();
- pending_request->service_name = name;
- pending_request->request = std::move(request);
- pending_requests_.push_back(std::move(pending_request));
- return;
- }
+ DCHECK(it != request_handlers_.end())
+ << "Can't create service " << name << ". No handler found.";
it->second.Run(std::move(request));
}
@@ -413,10 +392,6 @@ class ServiceManagerConnectionImpl::IOThreadContext
embedded_services_;
std::unordered_map<std::string, ServiceRequestHandler> request_handlers_;
- // Requests before the service have been registered are added here. Typically
- // there are very few elements, so we use a vector.
- std::vector<std::unique_ptr<PendingRequest>> pending_requests_;
-
mojo::Binding<mojom::Child> child_binding_;
base::WeakPtrFactory<IOThreadContext> weak_factory_;
« no previous file with comments | « chrome/browser/prefs/active_profile_pref_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698