summaryrefslogtreecommitdiff
path: root/src/node_wrap.h
Commit message (Collapse)AuthorAgeFilesLines
* src: shorten Object{Wrap,Unwrap}Trevor Norris2013-10-291-3/+3
| | | | | | Going back to the original names of Wrap/Unwrap now that most all the class members that duplicate the name and functionality have been removed.
* src: don't use class specific Unwrap methodsTrevor Norris2013-10-291-3/+5
| | | | Instead use the template functions in util.h.
* src: add multi-context supportBen Noordhuis2013-09-061-22/+23
| | | | | | | | | | | | | | | | | | | | | | | This commit makes it possible to use multiple V8 execution contexts within a single event loop. Put another way, handle and request wrap objects now "remember" the context they belong to and switch back to that context when the time comes to call into JS land. This could have been done in a quick and hacky way by calling v8::Object::GetCreationContext() on the wrap object right before making a callback but that leaves a fairly wide margin for bugs. Instead, we make the context explicit through a new Environment class that encapsulates everything (or almost everything) that belongs to the context. Variables that used to be a static or a global are now members of the aforementioned class. An additional benefit is that this approach should make it relatively straightforward to add full isolate support in due course. There is no JavaScript API yet but that will be added in the near future. This work was graciously sponsored by GitHub, Inc.
* src: constify WITH_GENERIC_STREAM macroBen Noordhuis2013-08-071-3/+3
| | | | | Make the pointer-to-wrap const (i.e. mutable but not assignable) to prevent accidental reassignment in the macro body.
* src: add IsEmpty() check to HasInstance()Ben Noordhuis2013-08-071-6/+3
| | | | | The check has virtually zero overhead and it simplifies the call sites because they were calling IsEmpty() anwyay.
* src: fix WITH_GENERIC_STREAM() type check bugBen Noordhuis2013-08-061-2/+2
| | | | | The handle object was checked against the wrong constructor template. Put another way, it was unwrapped as the wrong StreamWrap type.
* src: lint c++ codeFedor Indutny2013-07-311-4/+4
|
* lib, src: upgrade after v8 api changeBen Noordhuis2013-07-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a big commit that touches just about every file in the src/ directory. The V8 API has changed in significant ways. The most important changes are: * Binding functions take a const v8::FunctionCallbackInfo<T>& argument rather than a const v8::Arguments& argument. * Binding functions return void rather than v8::Handle<v8::Value>. The return value is returned with the args.GetReturnValue().Set() family of functions. * v8::Persistent<T> no longer derives from v8::Handle<T> and no longer allows you to directly dereference the object that the persistent handle points to. This means that the common pattern of caching oft-used JS values in a persistent handle no longer quite works, you first need to reconstruct a v8::Local<T> from the persistent handle with the Local<T>::New(isolate, persistent) factory method. A handful of (internal) convenience classes and functions have been added to make dealing with the new API a little easier. The most visible one is node::Cached<T>, which wraps a v8::Persistent<T> with some template sugar. It can hold arbitrary types but so far it's exclusively used for v8::Strings (which was by far the most commonly cached handle type.)
* build: fix include order for building on windowsTimothy J Fontaine2013-06-171-3/+3
| | | | fallout from the tls_wrap feature landing
* process: abstract out HandleToStreamFedor Indutny2013-06-151-0/+68
Originally contributed by @tjfontaine, but modified to be faster and more generic.