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

Unified Diff: samples/process.cc

Issue 104183002: Remove internal uses of HandleScope::Close(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/d8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/process.cc
diff --git a/samples/process.cc b/samples/process.cc
index b18a3ff875b0b031ebb3bda20420036636b7dee2..7e3f78fa75ff144502f4851aabd397fa1cf2faea 100644
--- a/samples/process.cc
+++ b/samples/process.cc
@@ -311,7 +311,7 @@ Persistent<ObjectTemplate> JsHttpRequestProcessor::map_template_;
// JavaScript object.
Handle<Object> JsHttpRequestProcessor::WrapMap(map<string, string>* obj) {
// Handle scope for temporary handles.
- HandleScope handle_scope(GetIsolate());
+ EscapableHandleScope handle_scope(GetIsolate());
// Fetch the template for creating JavaScript map wrappers.
// It only has to be created once, which we do on demand.
@@ -323,7 +323,7 @@ Handle<Object> JsHttpRequestProcessor::WrapMap(map<string, string>* obj) {
Local<ObjectTemplate>::New(GetIsolate(), map_template_);
// Create an empty map wrapper.
- Handle<Object> result = templ->NewInstance();
+ Local<Object> result = templ->NewInstance();
// Wrap the raw C++ pointer in an External so it can be referenced
// from within JavaScript.
@@ -336,7 +336,7 @@ Handle<Object> JsHttpRequestProcessor::WrapMap(map<string, string>* obj) {
// of these handles will go away when the handle scope is deleted
// we need to call Close to let one, the result, escape into the
// outer handle scope.
- return handle_scope.Close(result);
+ return handle_scope.Escape(result);
}
@@ -399,14 +399,14 @@ void JsHttpRequestProcessor::MapSet(Local<String> name,
Handle<ObjectTemplate> JsHttpRequestProcessor::MakeMapTemplate(
Isolate* isolate) {
- HandleScope handle_scope(isolate);
+ EscapableHandleScope handle_scope(isolate);
- Handle<ObjectTemplate> result = ObjectTemplate::New();
+ Local<ObjectTemplate> result = ObjectTemplate::New();
result->SetInternalFieldCount(1);
result->SetNamedPropertyHandler(MapGet, MapSet);
// Again, return the result through the current handle scope.
- return handle_scope.Close(result);
+ return handle_scope.Escape(result);
}
@@ -420,7 +420,7 @@ Handle<ObjectTemplate> JsHttpRequestProcessor::MakeMapTemplate(
*/
Handle<Object> JsHttpRequestProcessor::WrapRequest(HttpRequest* request) {
// Handle scope for temporary handles.
- HandleScope handle_scope(GetIsolate());
+ EscapableHandleScope handle_scope(GetIsolate());
// Fetch the template for creating JavaScript http request wrappers.
// It only has to be created once, which we do on demand.
@@ -432,7 +432,7 @@ Handle<Object> JsHttpRequestProcessor::WrapRequest(HttpRequest* request) {
Local<ObjectTemplate>::New(GetIsolate(), request_template_);
// Create an empty http request wrapper.
- Handle<Object> result = templ->NewInstance();
+ Local<Object> result = templ->NewInstance();
// Wrap the raw C++ pointer in an External so it can be referenced
// from within JavaScript.
@@ -445,7 +445,7 @@ Handle<Object> JsHttpRequestProcessor::WrapRequest(HttpRequest* request) {
// of these handles will go away when the handle scope is deleted
// we need to call Close to let one, the result, escape into the
// outer handle scope.
- return handle_scope.Close(result);
+ return handle_scope.Escape(result);
}
@@ -509,9 +509,9 @@ void JsHttpRequestProcessor::GetUserAgent(
Handle<ObjectTemplate> JsHttpRequestProcessor::MakeRequestTemplate(
Isolate* isolate) {
- HandleScope handle_scope(isolate);
+ EscapableHandleScope handle_scope(isolate);
- Handle<ObjectTemplate> result = ObjectTemplate::New();
+ Local<ObjectTemplate> result = ObjectTemplate::New();
result->SetInternalFieldCount(1);
// Add accessors for each of the fields of the request.
@@ -529,7 +529,7 @@ Handle<ObjectTemplate> JsHttpRequestProcessor::MakeRequestTemplate(
GetUserAgent);
// Again, return the result through the current handle scope.
- return handle_scope.Close(result);
+ return handle_scope.Escape(result);
}
« no previous file with comments | « no previous file | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698