mirror of
https://github.com/nodejs/node.git
synced 2024-11-29 07:00:59 +01:00
Add profile window around socket on_read.
This commit is contained in:
parent
43531093a3
commit
55d840ea96
@ -55,10 +55,12 @@ private:
|
||||
|
||||
static void on_read (oi_socket *s, const void *buf, size_t len) {
|
||||
Connection *connection = static_cast<Connection*> (s->data);
|
||||
v8::V8::ResumeProfiler();
|
||||
if (len == 0)
|
||||
connection->OnEOF();
|
||||
else
|
||||
connection->OnReceive(buf, len);
|
||||
v8::V8::PauseProfiler();
|
||||
}
|
||||
|
||||
static void on_drain (oi_socket *s) {
|
||||
|
@ -248,6 +248,8 @@ main (int argc, char *argv[])
|
||||
|
||||
Local<Object> g = Context::GetCurrent()->Global();
|
||||
|
||||
V8::PauseProfiler(); // to be resumed in Connection::on_read
|
||||
|
||||
Local<Object> node = Object::New();
|
||||
g->Set(String::New("node"), node);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user