Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Unified Diff: gin/modules/timer.cc

Issue 179803007: Refactors parts of gin: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix gin_shell Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gin/modules/module_runner_delegate.cc ('k') | gin/modules/timer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/modules/timer.cc
diff --git a/gin/modules/timer.cc b/gin/modules/timer.cc
index 6d59f56cc36af3bfceabe9fcbbb47b3274c35961..3196dda42587945f16b5893dadeba4d979f7838e 100644
--- a/gin/modules/timer.cc
+++ b/gin/modules/timer.cc
@@ -45,8 +45,8 @@ Timer::Timer(v8::Isolate* isolate, bool repeating, int delay_ms,
timer_(false, repeating),
runner_(PerContextData::From(
isolate->GetCurrentContext())->runner()->GetWeakPtr()) {
- GetWrapper(runner_->isolate())->SetHiddenValue(GetHiddenPropertyName(isolate),
- function);
+ GetWrapper(runner_->GetContextHolder()->isolate())->SetHiddenValue(
+ GetHiddenPropertyName(isolate), function);
timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(delay_ms),
base::Bind(&Timer::OnTimerFired, weak_factory_.GetWeakPtr()));
}
@@ -63,10 +63,10 @@ void Timer::OnTimerFired() {
}
Runner::Scope scope(runner_.get());
+ v8::Isolate* isolate = runner_->GetContextHolder()->isolate();
v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(
- GetWrapper(runner_->isolate())->GetHiddenValue(
- GetHiddenPropertyName(runner_->isolate())));
- runner_->Call(function, v8::Undefined(runner_->isolate()), 0, NULL);
+ GetWrapper(isolate)->GetHiddenValue(GetHiddenPropertyName(isolate)));
+ runner_->Call(function, v8::Undefined(isolate), 0, NULL);
}
« no previous file with comments | « gin/modules/module_runner_delegate.cc ('k') | gin/modules/timer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698