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

Side by Side Diff: src/d8-readline.cc

Issue 9138015: Enable asynchronous remote debugging with d8. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 11 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
« src/d8.cc ('K') | « src/d8.cc ('k') | no next file » | no next file with comments »
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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 return read_history(kHistoryFileName) == 0; 84 return read_history(kHistoryFileName) == 0;
85 } 85 }
86 86
87 87
88 bool ReadLineEditor::Close() { 88 bool ReadLineEditor::Close() {
89 return write_history(kHistoryFileName) == 0; 89 return write_history(kHistoryFileName) == 0;
90 } 90 }
91 91
92 92
93 Handle<String> ReadLineEditor::Prompt(const char* prompt) { 93 Handle<String> ReadLineEditor::Prompt(const char* prompt) {
94 char* result = readline(prompt); 94 char* result = NULL;
95 { // Release lock for blocking input.
96 Unlocker unlock(Isolate::GetCurrent());
97 result = readline(prompt);
98 }
95 if (result != NULL) { 99 if (result != NULL) {
96 AddHistory(result); 100 AddHistory(result);
97 } else { 101 } else {
98 return Handle<String>(); 102 return Handle<String>();
99 } 103 }
100 return String::New(result); 104 return String::New(result);
101 } 105 }
102 106
103 107
104 void ReadLineEditor::AddHistory(const char* str) { 108 void ReadLineEditor::AddHistory(const char* str) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 return strdup(*str); 151 return strdup(*str);
148 } else { 152 } else {
149 current_completions.Dispose(); 153 current_completions.Dispose();
150 current_completions.Clear(); 154 current_completions.Clear();
151 return NULL; 155 return NULL;
152 } 156 }
153 } 157 }
154 158
155 159
156 } // namespace v8 160 } // namespace v8
OLDNEW
« src/d8.cc ('K') | « src/d8.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698