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

Side by Side Diff: tools/pnacl-llc/SRPCStreamer.h

Issue 23753003: Report fatal translator errors to the browser (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: split errors from streamable readBytes and Header ReadPrefix Created 7 years, 3 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 | « lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp ('k') | tools/pnacl-llc/SRPCStreamer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===-- SRPCStreamer.h - Stream bitcode over SRPC ------------------------===// 1 //===-- SRPCStreamer.h - Stream bitcode over SRPC ------------------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 #ifndef SRPCSTREAMER_H 9 #ifndef SRPCSTREAMER_H
10 #define SRPCSTREAMER_H 10 #define SRPCSTREAMER_H
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 SRPCStreamer() : Error(false) {} 91 SRPCStreamer() : Error(false) {}
92 // Initialize streamer, create a new thread running Callback, and 92 // Initialize streamer, create a new thread running Callback, and
93 // return a pointer to the DataStreamer the threads will use to 93 // return a pointer to the DataStreamer the threads will use to
94 // synchronize. On error, return NULL and fill in the ErrorMsg string 94 // synchronize. On error, return NULL and fill in the ErrorMsg string
95 llvm::DataStreamer *init(void *(*Callback)(void *), 95 llvm::DataStreamer *init(void *(*Callback)(void *),
96 void *arg, std::string *ErrMsg); 96 void *arg, std::string *ErrMsg);
97 // Called by the RPC thread. Copy len bytes from buf. Return bytes copied. 97 // Called by the RPC thread. Copy len bytes from buf. Return bytes copied.
98 size_t gotChunk(unsigned char *bytes, size_t len); 98 size_t gotChunk(unsigned char *bytes, size_t len);
99 // Called by the RPC thread. Wait for the compilation thread to finish. 99 // Called by the RPC thread. Wait for the compilation thread to finish.
100 int streamEnd(std::string *ErrMsg); 100 int streamEnd(std::string *ErrMsg);
101 // Called by the compilation thread. Signal that there was a compilation 101 // Called by the compilation thread. Set the error condition and also
102 // error so the RPC thread can abort the stream. 102 // terminate the thread.
103 void setError() { Error = true; } 103 void setFatalError(const std::string& message);
104 private: 104 private:
105 bool Error; 105 int Error;
106 std::string ErrorMessage;
106 QueueStreamer Q; 107 QueueStreamer Q;
107 pthread_t CompileThread; 108 pthread_t CompileThread;
108 }; 109 };
109 110
110 111
111 112
112 #endif // SRPCSTREAMER_H 113 #endif // SRPCSTREAMER_H
OLDNEW
« no previous file with comments | « lib/Bitcode/NaCl/Reader/NaClBitcodeReader.cpp ('k') | tools/pnacl-llc/SRPCStreamer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698