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

Side by Side Diff: shell/launcher_main.cc

Issue 865253002: Delete temporary application file as soon as the application is launched. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: clang format Created 5 years, 11 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 "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 run_loop_.reset(); 52 run_loop_.reset();
53 return shell_handle_.is_valid(); 53 return shell_handle_.is_valid();
54 } 54 }
55 55
56 void Run() { 56 void Run() {
57 DCHECK(!run_loop_.get()); 57 DCHECK(!run_loop_.get());
58 DCHECK(shell_handle_.is_valid()); 58 DCHECK(shell_handle_.is_valid());
59 mojo::shell::InProcessDynamicServiceRunner service_runner(nullptr); 59 mojo::shell::InProcessDynamicServiceRunner service_runner(nullptr);
60 run_loop_.reset(new base::RunLoop); 60 run_loop_.reset(new base::RunLoop);
61 service_runner.Start( 61 service_runner.Start(
62 app_path_, shell_handle_.Pass(), 62 app_path_, false, shell_handle_.Pass(),
63 base::Bind(&Launcher::OnAppCompleted, base::Unretained(this))); 63 base::Bind(&Launcher::OnAppCompleted, base::Unretained(this)));
64 run_loop_->Run(); 64 run_loop_->Run();
65 run_loop_.reset(); 65 run_loop_.reset();
66 } 66 }
67 67
68 private: 68 private:
69 void OnConnected(int result) { 69 void OnConnected(int result) {
70 connect_result_ = result; 70 connect_result_ = result;
71 run_loop_->Quit(); 71 run_loop_->Quit();
72 } 72 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 110
111 if (!launcher.Register()) { 111 if (!launcher.Register()) {
112 LOG(ERROR) << "Error registering " 112 LOG(ERROR) << "Error registering "
113 << command_line->GetSwitchValueASCII(kAppURL); 113 << command_line->GetSwitchValueASCII(kAppURL);
114 return MOJO_RESULT_INVALID_ARGUMENT; 114 return MOJO_RESULT_INVALID_ARGUMENT;
115 } 115 }
116 116
117 launcher.Run(); 117 launcher.Run();
118 return MOJO_RESULT_OK; 118 return MOJO_RESULT_OK;
119 } 119 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698