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

Side by Side Diff: samples/process.cc

Issue 2036006: Fix typo in process sample. The initialization of the map template is... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 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 | « no previous file | 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 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 // ----------------------------------- 287 // -----------------------------------
288 288
289 // Utility function that wraps a C++ http request object in a 289 // Utility function that wraps a C++ http request object in a
290 // JavaScript object. 290 // JavaScript object.
291 Handle<Object> JsHttpRequestProcessor::WrapMap(map<string, string>* obj) { 291 Handle<Object> JsHttpRequestProcessor::WrapMap(map<string, string>* obj) {
292 // Handle scope for temporary handles. 292 // Handle scope for temporary handles.
293 HandleScope handle_scope; 293 HandleScope handle_scope;
294 294
295 // Fetch the template for creating JavaScript map wrappers. 295 // Fetch the template for creating JavaScript map wrappers.
296 // It only has to be created once, which we do on demand. 296 // It only has to be created once, which we do on demand.
297 if (request_template_.IsEmpty()) { 297 if (map_template_.IsEmpty()) {
298 Handle<ObjectTemplate> raw_template = MakeMapTemplate(); 298 Handle<ObjectTemplate> raw_template = MakeMapTemplate();
299 map_template_ = Persistent<ObjectTemplate>::New(raw_template); 299 map_template_ = Persistent<ObjectTemplate>::New(raw_template);
300 } 300 }
301 Handle<ObjectTemplate> templ = map_template_; 301 Handle<ObjectTemplate> templ = map_template_;
302 302
303 // Create an empty map wrapper. 303 // Create an empty map wrapper.
304 Handle<Object> result = templ->NewInstance(); 304 Handle<Object> result = templ->NewInstance();
305 305
306 // Wrap the raw C++ pointer in an External so it can be referenced 306 // Wrap the raw C++ pointer in an External so it can be referenced
307 // from within JavaScript. 307 // from within JavaScript.
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 JsHttpRequestProcessor processor(source); 613 JsHttpRequestProcessor processor(source);
614 map<string, string> output; 614 map<string, string> output;
615 if (!processor.Initialize(&options, &output)) { 615 if (!processor.Initialize(&options, &output)) {
616 fprintf(stderr, "Error initializing processor.\n"); 616 fprintf(stderr, "Error initializing processor.\n");
617 return 1; 617 return 1;
618 } 618 }
619 if (!ProcessEntries(&processor, kSampleSize, kSampleRequests)) 619 if (!ProcessEntries(&processor, kSampleSize, kSampleRequests))
620 return 1; 620 return 1;
621 PrintMap(&output); 621 PrintMap(&output);
622 } 622 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698