Skip to content
This repository
Newer
Older
100644 79 lines (65 sloc) 2.784 kb
60818b95 »
2011-11-02 Add missing copyright headers
1 // Copyright Joyent, Inc. and other Node contributors.
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a
4 // copy of this software and associated documentation files (the
5 // "Software"), to deal in the Software without restriction, including
6 // without limitation the rights to use, copy, modify, merge, publish,
7 // distribute, sublicense, and/or sell copies of the Software, and to permit
8 // persons to whom the Software is furnished to do so, subject to the
9 // following conditions:
10 //
11 // The above copyright notice and this permission notice shall be included
12 // in all copies or substantial portions of the Software.
13 //
14 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 // USE OR OTHER DEALINGS IN THE SOFTWARE.
21
0c7bf813 »
2011-07-18 Abstract out HandleWrap class
22 #ifndef HANDLE_WRAP_H_
23 #define HANDLE_WRAP_H_
24
5f040653 »
2012-04-28 process: add _getActiveHandles(), _getActiveRequests()
25 #include "ngx-queue.h"
26
0c7bf813 »
2011-07-18 Abstract out HandleWrap class
27 namespace node {
28
85404c5c »
2011-07-18 Move HandleWrap rules to one place
29 // Rules:
30 //
31 // - Do not throw from handle methods. Set errno.
32 //
33 // - MakeCallback may only be made directly off the event loop.
34 // That is there can be no JavaScript stack frames underneith it.
35 // (Is there anyway to assert that?)
36 //
37 // - No use of v8::WeakReferenceCallback. The close callback signifies that
38 // we're done with a handle - external resources can be freed.
39 //
40 // - Reusable?
41 //
42 // - The uv_close_cb is used to free the c++ object. The close callback
43 // is not made into javascript land.
44 //
45 // - uv_ref, uv_unref counts are managed at this layer to avoid needless
46 // js/c++ boundary crossing. At the javascript layer that should all be
47 // taken care of.
48
0c7bf813 »
2011-07-18 Abstract out HandleWrap class
49 class HandleWrap {
50 public:
51 static void Initialize(v8::Handle<v8::Object> target);
52 static v8::Handle<v8::Value> Close(const v8::Arguments& args);
3116522e »
2012-06-06 child_process: spawn().ref() and spawn().unref()
53 static v8::Handle<v8::Value> Ref(const v8::Arguments& args);
7e62bc98 »
2011-09-27 Move process.stdout unref hack to handle_wrap.cc
54 static v8::Handle<v8::Value> Unref(const v8::Arguments& args);
0c7bf813 »
2011-07-18 Abstract out HandleWrap class
55
56 protected:
57 HandleWrap(v8::Handle<v8::Object> object, uv_handle_t* handle);
58 virtual ~HandleWrap();
59
187fe27a »
2011-07-26 stdio binding + javascript to enable process.stdin.listen()
60 virtual void SetHandle(uv_handle_t* h);
0c7bf813 »
2011-07-18 Abstract out HandleWrap class
61
62 v8::Persistent<v8::Object> object_;
63
64 private:
5f040653 »
2012-04-28 process: add _getActiveHandles(), _getActiveRequests()
65 friend v8::Handle<v8::Value> GetActiveHandles(const v8::Arguments&);
0c7bf813 »
2011-07-18 Abstract out HandleWrap class
66 static void OnClose(uv_handle_t* handle);
5f040653 »
2012-04-28 process: add _getActiveHandles(), _getActiveRequests()
67 ngx_queue_t handle_wrap_queue_;
0c7bf813 »
2011-07-18 Abstract out HandleWrap class
68 // Using double underscore due to handle_ member in tcp_wrap. Probably
69 // tcp_wrap should rename it's member to 'handle'.
70 uv_handle_t* handle__;
039fac63 »
2012-05-17 deps: upgrade libuv to a478847
71 bool unref_;
0c7bf813 »
2011-07-18 Abstract out HandleWrap class
72 };
73
74
75 } // namespace node
76
77
78 #endif // HANDLE_WRAP_H_
Something went wrong with that request. Please try again.