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

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

Issue 658113003: [Mojo] ApplicationRunnerChromium should dump stacks in debug (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop/message_loop.h" 11 #include "base/message_loop/message_loop.h"
11 #include "mojo/common/message_pump_mojo.h" 12 #include "mojo/common/message_pump_mojo.h"
12 #include "mojo/public/cpp/application/application_delegate.h" 13 #include "mojo/public/cpp/application/application_delegate.h"
13 #include "mojo/public/cpp/application/application_impl.h" 14 #include "mojo/public/cpp/application/application_impl.h"
14 15
15 namespace mojo { 16 namespace mojo {
16 17
17 // static 18 // static
18 void ApplicationImpl::Terminate() { 19 void ApplicationImpl::Terminate() {
(...skipping 19 matching lines...) Expand all
38 39
39 MojoResult ApplicationRunnerChromium::Run(MojoHandle shell_handle) { 40 MojoResult ApplicationRunnerChromium::Run(MojoHandle shell_handle) {
40 DCHECK(!has_run_); 41 DCHECK(!has_run_);
41 has_run_ = true; 42 has_run_ = true;
42 43
43 base::CommandLine::Init(0, NULL); 44 base::CommandLine::Init(0, NULL);
44 #if !defined(COMPONENT_BUILD) 45 #if !defined(COMPONENT_BUILD)
45 base::AtExitManager at_exit; 46 base::AtExitManager at_exit;
46 #endif 47 #endif
47 48
49 #ifndef NDEBUG
50 base::debug::EnableInProcessStackDumping();
51 #endif
52
48 { 53 {
49 scoped_ptr<base::MessageLoop> loop; 54 scoped_ptr<base::MessageLoop> loop;
50 if (message_loop_type_ == base::MessageLoop::TYPE_CUSTOM) 55 if (message_loop_type_ == base::MessageLoop::TYPE_CUSTOM)
51 loop.reset(new base::MessageLoop(common::MessagePumpMojo::Create())); 56 loop.reset(new base::MessageLoop(common::MessagePumpMojo::Create()));
52 else 57 else
53 loop.reset(new base::MessageLoop(message_loop_type_)); 58 loop.reset(new base::MessageLoop(message_loop_type_));
54 59
55 ApplicationImpl impl(delegate_.get(), 60 ApplicationImpl impl(delegate_.get(),
56 MakeScopedHandle(MessagePipeHandle(shell_handle))); 61 MakeScopedHandle(MessagePipeHandle(shell_handle)));
57 loop->Run(); 62 loop->Run();
58 } 63 }
59 delegate_.reset(); 64 delegate_.reset();
60 return MOJO_RESULT_OK; 65 return MOJO_RESULT_OK;
61 } 66 }
62 67
63 } // namespace mojo 68 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698