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

Side by Side Diff: samples/lineprocessor.cc

Issue 15994003: remove most remaining V8_ALLOW_ACCESS_TO* defines (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years, 6 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 | « include/v8.h ('k') | samples/process.cc » ('j') | 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
11 // with the distribution. 11 // with the distribution.
12 // * Neither the name of Google Inc. nor the names of its 12 // * Neither the name of Google Inc. nor the names of its
13 // contributors may be used to endorse or promote products derived 13 // contributors may be used to endorse or promote products derived
14 // from this software without specific prior written permission. 14 // from this software without specific prior written permission.
15 // 15 //
16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 16 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 17 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 18 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 22 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 // TODO(dcarney): remove
29 #define V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR
30 #define V8_ALLOW_ACCESS_TO_PERSISTENT_IMPLICIT
31
32 #include <v8.h> 28 #include <v8.h>
33 29
34 #ifdef ENABLE_DEBUGGER_SUPPORT 30 #ifdef ENABLE_DEBUGGER_SUPPORT
35 #include <v8-debug.h> 31 #include <v8-debug.h>
36 #endif // ENABLE_DEBUGGER_SUPPORT 32 #endif // ENABLE_DEBUGGER_SUPPORT
37 33
38 #include <fcntl.h> 34 #include <fcntl.h>
39 #include <string.h> 35 #include <string.h>
40 #include <stdio.h> 36 #include <stdio.h>
41 #include <stdlib.h> 37 #include <stdlib.h>
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 v8::FunctionTemplate::New(ReadLine)); 211 v8::FunctionTemplate::New(ReadLine));
216 } 212 }
217 213
218 // Create a new execution environment containing the built-in 214 // Create a new execution environment containing the built-in
219 // functions 215 // functions
220 v8::Handle<v8::Context> context = v8::Context::New(isolate, NULL, global); 216 v8::Handle<v8::Context> context = v8::Context::New(isolate, NULL, global);
221 // Enter the newly created execution environment. 217 // Enter the newly created execution environment.
222 v8::Context::Scope context_scope(context); 218 v8::Context::Scope context_scope(context);
223 219
224 #ifdef ENABLE_DEBUGGER_SUPPORT 220 #ifdef ENABLE_DEBUGGER_SUPPORT
225 debug_message_context = 221 debug_message_context.Reset(isolate, context);
226 v8::Persistent<v8::Context>::New(isolate, context);
227 222
228 v8::Locker locker(isolate); 223 v8::Locker locker(isolate);
229 224
230 if (support_callback) { 225 if (support_callback) {
231 v8::Debug::SetDebugMessageDispatchHandler(DispatchDebugMessages, true); 226 v8::Debug::SetDebugMessageDispatchHandler(DispatchDebugMessages, true);
232 } 227 }
233 228
234 if (port_number != -1) { 229 if (port_number != -1) {
235 v8::Debug::EnableAgent("lineprocessor", port_number, wait_for_connection); 230 v8::Debug::EnableAgent("lineprocessor", port_number, wait_for_connection);
236 } 231 }
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 427
433 char* res; 428 char* res;
434 { 429 {
435 #ifdef ENABLE_DEBUGGER_SUPPORT 430 #ifdef ENABLE_DEBUGGER_SUPPORT
436 v8::Unlocker unlocker(v8::Isolate::GetCurrent()); 431 v8::Unlocker unlocker(v8::Isolate::GetCurrent());
437 #endif // ENABLE_DEBUGGER_SUPPORT 432 #endif // ENABLE_DEBUGGER_SUPPORT
438 res = fgets(buffer, kBufferSize, stdin); 433 res = fgets(buffer, kBufferSize, stdin);
439 } 434 }
440 if (res == NULL) { 435 if (res == NULL) {
441 v8::Handle<v8::Primitive> t = v8::Undefined(); 436 v8::Handle<v8::Primitive> t = v8::Undefined();
442 return v8::Handle<v8::String>(v8::String::Cast(*t)); 437 return v8::Handle<v8::String>::Cast(t);
443 } 438 }
444 // Remove newline char 439 // Remove newline char
445 for (char* pos = buffer; *pos != '\0'; pos++) { 440 for (char* pos = buffer; *pos != '\0'; pos++) {
446 if (*pos == '\n') { 441 if (*pos == '\n') {
447 *pos = '\0'; 442 *pos = '\0';
448 break; 443 break;
449 } 444 }
450 } 445 }
451 return v8::String::New(buffer); 446 return v8::String::New(buffer);
452 } 447 }
OLDNEW
« no previous file with comments | « include/v8.h ('k') | samples/process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698