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

Unified Diff: src/d8.h

Issue 12330171: Simplify line editor choice in d8. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: make it even simpler Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/d8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/d8.h
diff --git a/src/d8.h b/src/d8.h
index 1c3ce0a122ec8bbe776f42332001ef81b77cdf3c..c26b7e0f22b22dd6a9a5eb8813299c75bb71d939 100644
--- a/src/d8.h
+++ b/src/d8.h
@@ -118,22 +118,14 @@ class CounterMap {
class LineEditor {
public:
- enum Type { DUMB = 0, READLINE = 1 };
- LineEditor(Type type, const char* name);
- virtual ~LineEditor() { }
-
- virtual Handle<String> Prompt(const char* prompt) = 0;
- virtual bool Open() { return true; }
- virtual bool Close() { return true; }
- virtual void AddHistory(const char* str) { }
-
- const char* name() { return name_; }
- static LineEditor* Get();
+ explicit LineEditor(Isolate* isolate) : isolate_(isolate) { Open(); }
+ ~LineEditor();
+ void Open();
+ const char* name();
+ void AddHistory(const char* str);
+ Handle<String> Prompt(const char* prompt);
private:
- Type type_;
- const char* name_;
- LineEditor* next_;
- static LineEditor* first_;
+ Isolate* isolate_;
};
« no previous file with comments | « no previous file | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698