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

Unified Diff: samples/process.cc

Issue 12729023: first step to remove unsafe handles (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: issue with debug build Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samples/lineprocessor.cc ('k') | samples/shell.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 4dcc09a56b775c101ade9fced34b176e4b4eb7b1..75d6582e82b8c69aecb8a707ee40f6b75ccf18bb 100644
--- a/samples/process.cc
+++ b/samples/process.cc
@@ -25,6 +25,11 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// TODO(dcarney): remove this
+#define V8_ALLOW_ACCESS_TO_RAW_HANDLE_CONSTRUCTOR
+#define V8_ALLOW_ACCESS_TO_PERSISTENT_IMPLICIT
+#define V8_ALLOW_ACCESS_TO_PERSISTENT_ARROW
+
#include <v8.h>
#include <string>
@@ -167,7 +172,7 @@ bool JsHttpRequestProcessor::Initialize(map<string, string>* opts,
// Enter the new context so all the following operations take place
// within it.
- Context::Scope context_scope(context_);
+ Context::Scope context_scope(GetIsolate(), context_);
// Make the options mapping available within the context
if (!InstallMaps(opts, output))
@@ -250,7 +255,7 @@ bool JsHttpRequestProcessor::Process(HttpRequest* request) {
// Enter this processor's context so all the remaining operations
// take place there
- Context::Scope context_scope(context_);
+ Context::Scope context_scope(GetIsolate(), context_);
// Wrap the C++ request object in a JavaScript wrapper
Handle<Object> request_obj = WrapRequest(request);
@@ -303,7 +308,8 @@ Handle<Object> JsHttpRequestProcessor::WrapMap(map<string, string>* obj) {
Handle<ObjectTemplate> raw_template = MakeMapTemplate(GetIsolate());
map_template_ = Persistent<ObjectTemplate>::New(GetIsolate(), raw_template);
}
- Handle<ObjectTemplate> templ = map_template_;
+ Handle<ObjectTemplate> templ =
+ Local<ObjectTemplate>::New(GetIsolate(), map_template_);
// Create an empty map wrapper.
Handle<Object> result = templ->NewInstance();
@@ -410,7 +416,8 @@ Handle<Object> JsHttpRequestProcessor::WrapRequest(HttpRequest* request) {
request_template_ =
Persistent<ObjectTemplate>::New(GetIsolate(), raw_template);
}
- Handle<ObjectTemplate> templ = request_template_;
+ Handle<ObjectTemplate> templ =
+ Local<ObjectTemplate>::New(GetIsolate(), request_template_);
// Create an empty http request wrapper.
Handle<Object> result = templ->NewInstance();
« no previous file with comments | « samples/lineprocessor.cc ('k') | samples/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698