Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6936468

Browse filesBrowse files
Ido Ben-Yairrvagg
authored andcommitted
vm: remove Watchdog dependency on Environment
Remove the Watchdog class' dependency on Environment. No functional changes, only code cleanup. PR-URL: #3274 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent d5ce534 commit 6936468
Copy full SHA for 6936468

File tree

Expand file treeCollapse file tree

3 files changed

+8
-11
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+8
-11
lines changed
Open diff view settings
Collapse file

‎src/node_contextify.cc‎

Copy file name to clipboardExpand all lines: src/node_contextify.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ class ContextifyScript : public BaseObject {
693693

694694
Local<Value> result;
695695
if (timeout != -1) {
696-
Watchdog wd(env, timeout);
696+
Watchdog wd(env->isolate(), timeout);
697697
result = script->Run();
698698
} else {
699699
result = script->Run();
Collapse file

‎src/node_watchdog.cc‎

Copy file name to clipboardExpand all lines: src/node_watchdog.cc
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
#include "node_watchdog.h"
2-
#include "env.h"
3-
#include "env-inl.h"
42
#include "util.h"
3+
#include "util-inl.h"
54

65
namespace node {
76

87
using v8::V8;
98

109

11-
Watchdog::Watchdog(Environment* env, uint64_t ms) : env_(env),
12-
destroyed_(false) {
10+
Watchdog::Watchdog(v8::Isolate* isolate, uint64_t ms) : isolate_(isolate),
11+
destroyed_(false) {
1312
int rc;
1413
loop_ = new uv_loop_t;
1514
CHECK(loop_);
@@ -84,7 +83,7 @@ void Watchdog::Async(uv_async_t* async) {
8483
void Watchdog::Timer(uv_timer_t* timer) {
8584
Watchdog* w = ContainerOf(&Watchdog::timer_, timer);
8685
uv_stop(w->loop_);
87-
V8::TerminateExecution(w->env()->isolate());
86+
V8::TerminateExecution(w->isolate());
8887
}
8988

9089

Collapse file

‎src/node_watchdog.h‎

Copy file name to clipboardExpand all lines: src/node_watchdog.h
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@
44
#include "v8.h"
55
#include "uv.h"
66

7-
#include "env.h"
8-
97
namespace node {
108

119
class Watchdog {
1210
public:
13-
explicit Watchdog(Environment* env, uint64_t ms);
11+
explicit Watchdog(v8::Isolate* isolate, uint64_t ms);
1412
~Watchdog();
1513

1614
void Dispose();
1715

18-
inline Environment* env() const { return env_; }
16+
v8::Isolate* isolate() { return isolate_; }
1917

2018
private:
2119
void Destroy();
@@ -24,7 +22,7 @@ class Watchdog {
2422
static void Async(uv_async_t* async);
2523
static void Timer(uv_timer_t* timer);
2624

27-
Environment* env_;
25+
v8::Isolate* isolate_;
2826
uv_thread_t thread_;
2927
uv_loop_t* loop_;
3028
uv_async_t async_;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.