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

Side by Side Diff: mojo/application/application_runner_chromium.cc

Issue 1985223003: Factor stuff from ApplicationImpl out to a new class, ApplicationImplBase. (Closed) Base URL: https://github.com/domokit/mojo.git@work790_app_test_base_no_app_impl
Patch Set: fix android Created 4 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "mojo/application/application_runner_chromium.h" 5 #include "mojo/application/application_runner_chromium.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
11 #include "mojo/message_pump/message_pump_mojo.h" 11 #include "mojo/message_pump/message_pump_mojo.h"
12 #include "mojo/public/cpp/application/application_delegate.h" 12 #include "mojo/public/cpp/application/application_delegate.h"
13 #include "mojo/public/cpp/application/application_impl.h" 13 #include "mojo/public/cpp/application/application_impl.h"
14 #include "mojo/public/cpp/application/application_impl_base.h"
14 #include "mojo/public/cpp/system/handle.h" 15 #include "mojo/public/cpp/system/handle.h"
15 #include "mojo/public/cpp/system/message_pipe.h" 16 #include "mojo/public/cpp/system/message_pipe.h"
16 17
17 namespace mojo { 18 namespace mojo {
18 19
19 // static 20 // static
20 void ApplicationImpl::Terminate() { 21 void ApplicationImplBase::Terminate() {
21 if (base::MessageLoop::current()->is_running()) 22 if (base::MessageLoop::current()->is_running())
22 base::MessageLoop::current()->Quit(); 23 base::MessageLoop::current()->Quit();
23 } 24 }
24 25
25 ApplicationRunnerChromium::ApplicationRunnerChromium( 26 ApplicationRunnerChromium::ApplicationRunnerChromium(
26 ApplicationDelegate* delegate) 27 ApplicationDelegate* delegate)
27 : delegate_(delegate), 28 : delegate_(delegate),
28 message_loop_type_(base::MessageLoop::TYPE_CUSTOM), 29 message_loop_type_(base::MessageLoop::TYPE_CUSTOM),
29 has_run_(false) {} 30 has_run_(false) {}
30 31
(...skipping 29 matching lines...) Expand all
60 ApplicationImpl impl(delegate_.get(), 61 ApplicationImpl impl(delegate_.get(),
61 InterfaceRequest<Application>(MakeScopedHandle( 62 InterfaceRequest<Application>(MakeScopedHandle(
62 MessagePipeHandle(application_request_handle)))); 63 MessagePipeHandle(application_request_handle))));
63 loop->Run(); 64 loop->Run();
64 } 65 }
65 delegate_.reset(); 66 delegate_.reset();
66 return MOJO_RESULT_OK; 67 return MOJO_RESULT_OK;
67 } 68 }
68 69
69 } // namespace mojo 70 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698