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

Side by Side Diff: services/navigation/navigation.cc

Issue 2476063002: Service Manager: Rework Service and ServiceContext lifetime (Closed)
Patch Set: . Created 4 years, 1 month 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 | « services/file/file_service.cc ('k') | services/navigation/navigation_unittest.cc » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "services/navigation/navigation.h" 5 #include "services/navigation/navigation.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/threading/thread_task_runner_handle.h" 9 #include "base/threading/thread_task_runner_handle.h"
10 #include "mojo/public/cpp/bindings/strong_binding.h" 10 #include "mojo/public/cpp/bindings/strong_binding.h"
11 #include "services/navigation/view_impl.h" 11 #include "services/navigation/view_impl.h"
12 #include "services/service_manager/public/cpp/connector.h" 12 #include "services/service_manager/public/cpp/connector.h"
13 #include "services/service_manager/public/cpp/interface_registry.h"
13 14
14 namespace navigation { 15 namespace navigation {
15 16
16 namespace { 17 namespace {
17 18
18 void CreateViewOnViewTaskRunner( 19 void CreateViewOnViewTaskRunner(
19 std::unique_ptr<service_manager::Connector> connector, 20 std::unique_ptr<service_manager::Connector> connector,
20 const std::string& client_user_id, 21 const std::string& client_user_id,
21 mojom::ViewClientPtr client, 22 mojom::ViewClientPtr client,
22 mojom::ViewRequest request, 23 mojom::ViewRequest request,
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 void Navigation::CreateViewFactory(mojom::ViewFactoryRequest request) { 71 void Navigation::CreateViewFactory(mojom::ViewFactoryRequest request) {
71 bindings_.AddBinding(this, std::move(request)); 72 bindings_.AddBinding(this, std::move(request));
72 refs_.insert(ref_factory_.CreateRef()); 73 refs_.insert(ref_factory_.CreateRef());
73 } 74 }
74 75
75 void Navigation::ViewFactoryLost() { 76 void Navigation::ViewFactoryLost() {
76 refs_.erase(refs_.begin()); 77 refs_.erase(refs_.begin());
77 } 78 }
78 79
79 } // navigation 80 } // navigation
OLDNEW
« no previous file with comments | « services/file/file_service.cc ('k') | services/navigation/navigation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698