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

Unified Diff: src/d8.h

Issue 7885026: Fixing d8's broken readline history. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed a presubmit issue. Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/d8.cc » ('j') | src/d8-readline.cc » ('J')
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 e193f105a0d1cc601efc0d81b09d2b9494133a83..15d8d5d50fc96214df64ce7925487bdd360c068a 100644
--- a/src/d8.h
+++ b/src/d8.h
@@ -116,6 +116,29 @@ class CounterMap {
#endif // V8_SHARED
+#ifndef V8_SHARED
+class LineEditor {
+ public:
+ enum Type { DUMB = 0, READLINE = 1 };
+ LineEditor(Type type, const char* name);
+ virtual ~LineEditor() { }
+
+ virtual i::SmartArrayPointer<char> 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();
+ private:
+ Type type_;
+ const char* name_;
+ LineEditor* next_;
+ static LineEditor* first_;
+};
+#endif // V8_SHARED
+
+
class SourceGroup {
public:
SourceGroup() :
@@ -313,6 +336,8 @@ class Shell : public i::AllStatic {
static void AddOSMethods(Handle<ObjectTemplate> os_template);
#ifndef V8_SHARED
static const char* kHistoryFileName;
+ static const int kMaxHistoryEntries;
+ static LineEditor* console;
#endif // V8_SHARED
static const char* kPrompt;
static ShellOptions options;
@@ -343,29 +368,6 @@ class Shell : public i::AllStatic {
};
-#ifndef V8_SHARED
-class LineEditor {
- public:
- enum Type { DUMB = 0, READLINE = 1 };
- LineEditor(Type type, const char* name);
- virtual ~LineEditor() { }
-
- virtual i::SmartArrayPointer<char> 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();
- private:
- Type type_;
- const char* name_;
- LineEditor* next_;
- static LineEditor* first_;
-};
-#endif // V8_SHARED
-
-
} // namespace v8
« no previous file with comments | « no previous file | src/d8.cc » ('j') | src/d8-readline.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698