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

Unified Diff: src/IceCompileServer.h

Issue 1494753003: cleanup main (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: else clause no longer needed 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 | « src/IceBuildDefs.h ('k') | src/main.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCompileServer.h
diff --git a/src/IceCompileServer.h b/src/IceCompileServer.h
index 9b02f92c85259263ff07f89787d811b741f6c80d..ca02577b78b302faa08f3df6d9f6336266e59c4d 100644
--- a/src/IceCompileServer.h
+++ b/src/IceCompileServer.h
@@ -41,12 +41,11 @@ namespace Ice {
/// request immediately. When run in the browser, it blocks waiting for a
/// request.
class CompileServer {
- CompileServer() = delete;
CompileServer(const CompileServer &) = delete;
CompileServer &operator=(const CompileServer &) = delete;
public:
- explicit CompileServer(Compiler &Comp) : Comp(Comp) {}
+ CompileServer() = default;
virtual ~CompileServer() = default;
@@ -55,10 +54,15 @@ public:
virtual ErrorCode &getErrorCode() { return LastError; }
void transferErrorCode(ErrorCodes Code) { LastError.assign(Code); }
+ int runAndReturnErrorCode() {
+ run();
+ return getErrorCode().value();
+ }
+
protected:
- Compiler &getCompiler() const { return Comp; }
+ Compiler &getCompiler() { return Comp; }
- Compiler &Comp;
+ Compiler Comp;
ErrorCode LastError;
};
@@ -69,8 +73,7 @@ class CLCompileServer : public CompileServer {
CLCompileServer &operator=(const CLCompileServer &) = delete;
public:
- CLCompileServer(Compiler &Comp, int argc, char **argv)
- : CompileServer(Comp), argc(argc), argv(argv) {}
+ CLCompileServer(int argc, char **argv) : argc(argc), argv(argv) {}
~CLCompileServer() final = default;
« no previous file with comments | « src/IceBuildDefs.h ('k') | src/main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698