summaryrefslogtreecommitdiff
path: root/src/process_wrap.cc
AgeCommit message (Collapse)Author
2014-06-10Merge remote-tracking branch 'upstream/v0.10'Timothy J Fontaine
Conflicts: AUTHORS ChangeLog deps/v8/src/api.cc deps/v8/src/unicode-inl.h deps/v8/src/unicode.h lib/_stream_readable.js lib/http.js src/cares_wrap.cc src/node.cc src/node_crypto.cc src/node_dtrace.cc src/node_file.cc src/node_stat_watcher.cc src/node_version.h src/process_wrap.cc src/string_bytes.cc src/string_bytes.h src/udp_wrap.cc src/util.h test/simple/test-buffer.js test/simple/test-stream2-compatibility.js
2014-06-06src: replace usage of String::Utf8ValueTimothy J Fontaine
v8::String::Utf8Value previously could allow invalid surrogates when interpreting values.
2014-04-02node: add signature to SET_PROTOTYPE_METHODC. Scott Ananian
This prevents segfaults when a native method is reassigned to a different object (which corrupts args.This()). When unwrapping, clients should use args.Holder() instead of args.This(). Closes #6690. Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-03-13src: update to v8 3.24 APIsFedor Indutny
2014-02-22src: remove `node_isolate` from sourceFedor Indutny
fix #6899
2014-02-05async_wrap: add provider types/pass to constructorTrevor Norris
These will be used to allow users to filter for which types of calls they wish their callbacks to run. Signed-off-by: Timothy J Fontaine <tjfontaine@gmail.com>
2014-01-27node: register modules from DSO constructorsKeith M Wesolowski
Built-in modules should be automatically registered, replacing the static module list. Add-on modules should also be automatically registered via DSO constructors. This improves flexibility in adding built-in modules and is also a prerequisite to pure-C addon modules.
2013-11-12src: fix Context::Scope usageBen Noordhuis
env->context() may or may not create a new Local. It currently does not but don't depend on that behavior, create a HandleScope first.
2013-11-11src: fix Environment::GetCurrent() usageBen Noordhuis
Create a HandleScope before calling the Environment::GetCurrent() that takes a v8::Isolate* as an argument because it creates a handle with the call to v8::Isolate::CurrentContext().
2013-10-31node: add AsyncListener supportTrevor Norris
AsyncListener is a JS API that works in tandem with the AsyncWrap class to allow the user to be alerted to key events in the life cycle of an asynchronous event. The AsyncWrap class has its own MakeCallback implementation that core will be migrated to use, and uses state sharing techniques to allow quicker communication between JS and C++ whether the async event callbacks need to be called.
2013-10-29src: shorten Object{Wrap,Unwrap}Trevor Norris
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.
2013-10-29src: don't use class specific Unwrap methodsTrevor Norris
Instead use the template functions in util.h.
2013-10-29src: use function to get internal pointerTrevor Norris
Remove the NODE_{WRAP,UNWRAP} macros and instead use template functions.
2013-09-06src: add multi-context supportBen Noordhuis
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.
2013-09-03uv: upgrade to v0.11.12Ben Noordhuis
* upgrade deps/uv/ to v0.11.12. * update files in src/ after a libuv API change.
2013-08-25process_wrap: don't coerce process exit code to int32_tBert Belder
On windows process exit codes can be greater than INT32_MAX. This used to be not much of a problem - greater values would just come out negative. However since ca9eb71 a negative result value indicates that uv_spawn() has failed, so this is no longer acceptable.
2013-08-23process_wrap: update after libuv api changeBert Belder
The `exit_code` argument for the `ProcessWrap::OnExit` callback changed from int to int64_t.
2013-08-12src: fix build break from generic macro nameTrevor Norris
WRAP is too generic a macro name and causes the build to fail from conflicts. They have been prepended with NODE_.
2013-08-12src: centralize class wrap/unwrapTrevor Norris
While almost all cases were handled by simple WRAP/UNWRAP macros, this extends those to cover all known occurrences.
2013-08-09src: use v8::String::NewFrom*() functionsBen Noordhuis
* Change calls to String::New() and String::NewSymbol() to their respective one-byte, two-byte and UTF-8 counterparts. * Add a FIXED_ONE_BYTE_STRING macro that takes a string literal and turns it into a v8::Local<v8::String>. * Add helper functions that make v8::String::NewFromOneByte() easier to work with. Said function expects a `const uint8_t*` but almost every call site deals with `const char*` or `const unsigned char*`. Helps us avoid doing reinterpret_casts all over the place. * Code that handles file system paths keeps using UTF-8 for backwards compatibility reasons. At least now the use of UTF-8 is explicit. * Remove v8::String::NewSymbol() entirely. Almost all call sites were effectively minor de-optimizations. If you create a string only once, there is no point in making it a symbol. If you are create the same string repeatedly, it should probably be cached in a persistent handle.
2013-08-07src: remove no-op HandleWrap::Initialize()Ben Noordhuis
It's never been used and we probably never will. Remove it.
2013-08-06process_wrap: omit superfluous Number creationBen Noordhuis
Don't create a superfluous Number object, just use the version of v8::Object::Get() that takes an unsigned int. Convert the index to unsigned int while we're here.
2013-07-31src: lint c++ codeFedor Indutny
2013-07-20src, lib: update after internal api changeBen Noordhuis
Libuv now returns errors directly. Make everything in src/ and lib/ follow suit. The changes to lib/ are not strictly necessary but they remove the need for the abominations that are process._errno and node::SetErrno().
2013-07-06lib, src: upgrade after v8 api changeBen Noordhuis
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.)
2013-06-17src: clean up `using` directivesBen Noordhuis
Remove the unused ones and alphabetically sort the ones that remain.
2013-06-15process: abstract out HandleToStreamFedor Indutny
Originally contributed by @tjfontaine, but modified to be faster and more generic.
2013-05-30src: simplify HandleWrap initializationBen Noordhuis
2013-05-30src: replace c-style casts with c++-style castsBen Noordhuis
2013-03-20src: pass Isolate to all applicable apiTrevor Norris
Update the api to pass node_isolate to all supported methods. Much thanks to Ben Noordhuis and his work in 51f6e6a.
2013-02-25src, test: downgrade to v8 3.14 apiBen Noordhuis
2013-01-07src: pass node_isolate to Integer::NewBen Noordhuis
2012-08-21child_process: emit error on exec failureBen Noordhuis
libuv calls the exit cb with exit code == -1 when it fails to spawn the new process. Anticipate that and emit the error on the ChildProcess object.
2012-06-11process_wrap: set duplex flags when creating a pipeBert Belder
2012-06-08child_process: expose UV_PROCESS_DETACHED as options.detachedCharlie McConnell
2012-06-07child_process: spawn().ref() and spawn().unref()Fedor Indutny
2012-06-01child_process: new stdio API for .spawn() methodFedor Indutny
2012-05-29deps: upgrade libuv to 7556590Fedor Indutny
2012-05-21Make UNWRAP macro generic.Oleg Efimov
2012-04-29process_wrap: don't use uv_spawn2Bert Belder
It was a temporary thing for the 0.6 branch only.
2012-04-29Merge branch 'v0.6'Bert Belder
Conflicts: deps/uv/include/uv-private/uv-unix.h deps/uv/include/uv-private/uv-win.h deps/uv/src/uv-common.c deps/uv/src/win/fs.c src/process_wrap.cc
2012-04-28process: don't use strdup()ssuda
file and cwd can be directly used from Utf8Value. Conflicts: src/process_wrap.cc
2012-04-28process_wrap: avoid leaking memory when throwing due to invalid argumentsBert Belder
2012-04-27Child process: support the `gid` and `uid` optionsBert Belder
2012-04-17MakeCallback: Consistent symbol usageisaacs
2012-03-23Avoiding unnecessary ToString() callsssuda
String::Utf8Value and String::AsciiValue constructors take Handle<Value> So no need to convert to Handle<String>
2012-03-20process: don't use strdup()ssuda
file and cwd can be directly used from Utf8Value.
2012-03-10core: use proper #include directivesBen Noordhuis
2012-02-06Revert support for isolates.Ben Noordhuis
It was decided that the performance benefits that isolates offer (faster spin-up times for worker processes, faster inter-worker communication, possibly a lower memory footprint) are not actual bottlenecks for most people and do not outweigh the potential stability issues and intrusive changes to the code base that first-class support for isolates requires. Hence, this commit backs out all isolates-related changes. Good bye, isolates. We hardly knew ye.
2012-01-12Merge branch 'v0.6'Fedor Indutny
Conflicts: src/handle_wrap.cc src/node_zlib.cc src/process_wrap.cc