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

Side by Side Diff: components/resource_provider/resource_provider_test_app.cc

Issue 1819063002: Quit the message loop by default in ShellConnectionLost when ApplicationRunner is used (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge and update resourceproviderunittest Created 4 years, 9 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
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/files/file.h" 8 #include "base/files/file.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // mojo::ShellClient: 92 // mojo::ShellClient:
93 void Initialize(mojo::Connector* connector, 93 void Initialize(mojo::Connector* connector,
94 const mojo::Identity& identity, 94 const mojo::Identity& identity,
95 uint32_t id) override { 95 uint32_t id) override {
96 test_.reset(new Test(connector)); 96 test_.reset(new Test(connector));
97 } 97 }
98 bool AcceptConnection(mojo::Connection* connection) override { 98 bool AcceptConnection(mojo::Connection* connection) override {
99 connection->AddInterface<mojom::Test>(this); 99 connection->AddInterface<mojom::Test>(this);
100 return true; 100 return true;
101 } 101 }
102 void ShellConnectionLost() override {
103 base::MessageLoop::current()->QuitWhenIdle();
104 }
105 102
106 // InterfaceFactory<mojom::Test>: 103 // InterfaceFactory<mojom::Test>:
107 void Create(mojo::Connection* connection, 104 void Create(mojo::Connection* connection,
108 mojom::TestRequest request) override { 105 mojom::TestRequest request) override {
109 printf("test app create\n"); 106 printf("test app create\n");
110 bindings_.AddBinding(test_.get(), std::move(request)); 107 bindings_.AddBinding(test_.get(), std::move(request));
111 } 108 }
112 109
113 private: 110 private:
114 scoped_ptr<Test> test_; 111 scoped_ptr<Test> test_;
115 mojo::BindingSet<test::mojom::Test> bindings_; 112 mojo::BindingSet<test::mojom::Test> bindings_;
116 113
117 DISALLOW_COPY_AND_ASSIGN(TestApp); 114 DISALLOW_COPY_AND_ASSIGN(TestApp);
118 }; 115 };
119 116
120 } // namespace test 117 } // namespace test
121 } // namespace resource_provider 118 } // namespace resource_provider
122 119
123 MojoResult MojoMain(MojoHandle shell_handle) { 120 MojoResult MojoMain(MojoHandle shell_handle) {
124 return mojo::ApplicationRunner(new resource_provider::test::TestApp) 121 return mojo::ApplicationRunner(new resource_provider::test::TestApp)
125 .Run(shell_handle); 122 .Run(shell_handle);
126 } 123 }
OLDNEW
« no previous file with comments | « components/resource_provider/resource_provider_app.cc ('k') | content/common/mojo/mojo_shell_connection_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698