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

Side by Side Diff: samples/lineprocessor.cc

Issue 15837007: remove use of context scope with persistent argument (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 // but we shouldn't worry about this. 123 // but we shouldn't worry about this.
124 // 124 //
125 // All we have to do is to set context and call ProcessDebugMessages. 125 // All we have to do is to set context and call ProcessDebugMessages.
126 // 126 //
127 // We should decide which V8 context to use here. This is important for 127 // We should decide which V8 context to use here. This is important for
128 // "evaluate" command, because it must be executed some context. 128 // "evaluate" command, because it must be executed some context.
129 // In our sample we have only one context, so there is nothing really to 129 // In our sample we have only one context, so there is nothing really to
130 // think about. 130 // think about.
131 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 131 v8::Isolate* isolate = v8::Isolate::GetCurrent();
132 v8::HandleScope handle_scope(isolate); 132 v8::HandleScope handle_scope(isolate);
133 v8::Context::Scope scope(isolate, debug_message_context); 133 v8::Local<v8::Context> context =
134 v8::Local<v8::Context>::New(isolate, debug_message_context);
135 v8::Context::Scope scope(context);
134 136
135 v8::Debug::ProcessDebugMessages(); 137 v8::Debug::ProcessDebugMessages();
136 } 138 }
137 #endif // ENABLE_DEBUGGER_SUPPORT 139 #endif // ENABLE_DEBUGGER_SUPPORT
138 140
139 141
140 int RunMain(int argc, char* argv[]) { 142 int RunMain(int argc, char* argv[]) {
141 v8::V8::SetFlagsFromCommandLine(&argc, argv, true); 143 v8::V8::SetFlagsFromCommandLine(&argc, argv, true);
142 v8::Isolate* isolate = v8::Isolate::GetCurrent(); 144 v8::Isolate* isolate = v8::Isolate::GetCurrent();
143 v8::HandleScope handle_scope(isolate); 145 v8::HandleScope handle_scope(isolate);
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 } 443 }
442 // Remove newline char 444 // Remove newline char
443 for (char* pos = buffer; *pos != '\0'; pos++) { 445 for (char* pos = buffer; *pos != '\0'; pos++) {
444 if (*pos == '\n') { 446 if (*pos == '\n') {
445 *pos = '\0'; 447 *pos = '\0';
446 break; 448 break;
447 } 449 }
448 } 450 }
449 return v8::String::New(buffer); 451 return v8::String::New(buffer);
450 } 452 }
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