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

Side by Side 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: Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/d8.cc » ('j') | src/d8.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 enum Type { DUMB = 0, READLINE = 1 }; 121 enum Type { DUMB = 0, READLINE = 1 };
122 LineEditor(Type type, const char* name); 122 LineEditor(Type type, const char* name);
123 virtual ~LineEditor() { } 123 virtual ~LineEditor() { }
124 124
125 virtual Handle<String> Prompt(const char* prompt) = 0; 125 virtual Handle<String> Prompt(const char* prompt) = 0;
126 virtual bool Open() { return true; } 126 virtual bool Open() { return true; }
127 virtual bool Close() { return true; } 127 virtual bool Close() { return true; }
128 virtual void AddHistory(const char* str) { } 128 virtual void AddHistory(const char* str) { }
129 129
130 const char* name() { return name_; } 130 const char* name() { return name_; }
131 static LineEditor* Get(); 131 static LineEditor* Get() { return current_; }
132 private: 132 private:
133 Type type_; 133 Type type_;
134 const char* name_; 134 const char* name_;
135 LineEditor* next_; 135 static LineEditor* current_;
136 static LineEditor* first_;
137 }; 136 };
138 137
139 138
140 class SourceGroup { 139 class SourceGroup {
141 public: 140 public:
142 SourceGroup() : 141 SourceGroup() :
143 #ifndef V8_SHARED 142 #ifndef V8_SHARED
144 next_semaphore_(v8::internal::OS::CreateSemaphore(0)), 143 next_semaphore_(v8::internal::OS::CreateSemaphore(0)),
145 done_semaphore_(v8::internal::OS::CreateSemaphore(0)), 144 done_semaphore_(v8::internal::OS::CreateSemaphore(0)),
146 thread_(NULL), 145 thread_(NULL),
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 static void ExternalArrayWeakCallback(Isolate* isolate, 406 static void ExternalArrayWeakCallback(Isolate* isolate,
408 Persistent<Value> object, 407 Persistent<Value> object,
409 void* data); 408 void* data);
410 }; 409 };
411 410
412 411
413 } // namespace v8 412 } // namespace v8
414 413
415 414
416 #endif // V8_D8_H_ 415 #endif // V8_D8_H_
OLDNEW
« no previous file with comments | « no previous file | src/d8.cc » ('j') | src/d8.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698