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

Side by Side Diff: samples/lineprocessor.cc

Issue 238353015: Simplify v8/Isolate teardown. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Tiny serializer fix after recent changes. Created 6 years, 8 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 | 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 const char* cstr = ToCString(str); 321 const char* cstr = ToCString(str);
322 printf("%s\n", cstr); 322 printf("%s\n", cstr);
323 } 323 }
324 324
325 return true; 325 return true;
326 } 326 }
327 327
328 328
329 int main(int argc, char* argv[]) { 329 int main(int argc, char* argv[]) {
330 v8::V8::InitializeICU(); 330 v8::V8::InitializeICU();
331 v8::V8::Initialize();
331 int result = RunMain(argc, argv); 332 int result = RunMain(argc, argv);
332 v8::V8::Dispose(); 333 v8::V8::Dispose();
333 return result; 334 return result;
334 } 335 }
335 336
336 337
337 // Extracts a C string from a V8 Utf8Value. 338 // Extracts a C string from a V8 Utf8Value.
338 const char* ToCString(const v8::String::Utf8Value& value) { 339 const char* ToCString(const v8::String::Utf8Value& value) {
339 return *value ? *value : "<string conversion failed>"; 340 return *value ? *value : "<string conversion failed>";
340 } 341 }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 } 448 }
448 // Remove newline char 449 // Remove newline char
449 for (char* pos = buffer; *pos != '\0'; pos++) { 450 for (char* pos = buffer; *pos != '\0'; pos++) {
450 if (*pos == '\n') { 451 if (*pos == '\n') {
451 *pos = '\0'; 452 *pos = '\0';
452 break; 453 break;
453 } 454 }
454 } 455 }
455 return v8::String::NewFromUtf8(isolate, buffer); 456 return v8::String::NewFromUtf8(isolate, buffer);
456 } 457 }
OLDNEW
« no previous file with comments | « no previous file | samples/process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698