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

Side by Side Diff: samples/process.cc

Issue 12033011: Add Isolate parameter to Persistent class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added new kind of callback Created 7 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
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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 } else { 266 } else {
267 return true; 267 return true;
268 } 268 }
269 } 269 }
270 270
271 271
272 JsHttpRequestProcessor::~JsHttpRequestProcessor() { 272 JsHttpRequestProcessor::~JsHttpRequestProcessor() {
273 // Dispose the persistent handles. When noone else has any 273 // Dispose the persistent handles. When noone else has any
274 // references to the objects stored in the handles they will be 274 // references to the objects stored in the handles they will be
275 // automatically reclaimed. 275 // automatically reclaimed.
276 context_.Dispose(); 276 v8::Isolate* isolate = context_->GetIsolate();
277 process_.Dispose(); 277 context_.Dispose(isolate);
278 process_.Dispose(isolate);
278 } 279 }
279 280
280 281
281 Persistent<ObjectTemplate> JsHttpRequestProcessor::request_template_; 282 Persistent<ObjectTemplate> JsHttpRequestProcessor::request_template_;
282 Persistent<ObjectTemplate> JsHttpRequestProcessor::map_template_; 283 Persistent<ObjectTemplate> JsHttpRequestProcessor::map_template_;
283 284
284 285
285 // ----------------------------------- 286 // -----------------------------------
286 // --- A c c e s s i n g M a p s --- 287 // --- A c c e s s i n g M a p s ---
287 // ----------------------------------- 288 // -----------------------------------
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 JsHttpRequestProcessor processor(source); 614 JsHttpRequestProcessor processor(source);
614 map<string, string> output; 615 map<string, string> output;
615 if (!processor.Initialize(&options, &output)) { 616 if (!processor.Initialize(&options, &output)) {
616 fprintf(stderr, "Error initializing processor.\n"); 617 fprintf(stderr, "Error initializing processor.\n");
617 return 1; 618 return 1;
618 } 619 }
619 if (!ProcessEntries(&processor, kSampleSize, kSampleRequests)) 620 if (!ProcessEntries(&processor, kSampleSize, kSampleRequests))
620 return 1; 621 return 1;
621 PrintMap(&output); 622 PrintMap(&output);
622 } 623 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698