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

Unified Diff: mojo/public/cpp/application/application_runner.h

Issue 1517743003: Make ApplicationRunner's ctor's ApplicationDelegate* argument an std::unique_ptr instead. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « examples/wget/wget.cc ('k') | mojo/public/cpp/application/lib/application_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/cpp/application/application_runner.h
diff --git a/mojo/public/cpp/application/application_runner.h b/mojo/public/cpp/application/application_runner.h
index aa351b1959b6281d8da82ba6682566e19a41f23a..5a2ea7723f2304fe0ad2b5cbd9954925f28e3bed 100644
--- a/mojo/public/cpp/application/application_runner.h
+++ b/mojo/public/cpp/application/application_runner.h
@@ -5,6 +5,8 @@
#ifndef MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_RUNNER_H_
#define MOJO_PUBLIC_CPP_APPLICATION_APPLICATION_RUNNER_H_
+#include <memory>
+
#include "mojo/public/c/environment/logger.h"
#include "mojo/public/cpp/system/core.h"
@@ -25,8 +27,7 @@ class ApplicationDelegate;
// ultimately Quit().
class ApplicationRunner {
public:
- // Takes ownership of |delegate|.
- explicit ApplicationRunner(ApplicationDelegate* delegate);
+ explicit ApplicationRunner(std::unique_ptr<ApplicationDelegate> delegate);
~ApplicationRunner();
// This replaces the underlying logger implementation with the one provided.
@@ -43,7 +44,7 @@ class ApplicationRunner {
MojoResult Run(MojoHandle application_request);
private:
- ApplicationDelegate* delegate_;
+ std::unique_ptr<ApplicationDelegate> delegate_;
MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationRunner);
};
« no previous file with comments | « examples/wget/wget.cc ('k') | mojo/public/cpp/application/lib/application_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698