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

Side by Side Diff: pdf/timer.cc

Issue 2349753003: Improve linearized pdf load/show time. (Closed)
Patch Set: fix review issues. Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "pdf/timer.h"
6
7 #include "ppapi/cpp/core.h"
8 #include "ppapi/cpp/module.h"
9
10 namespace chrome_pdf {
11
12 Timer::Timer(int delay) : delay_(delay), callback_factory_(this) {
13 PostCallback();
14 }
15
16 Timer::~Timer() {
17 }
18
19 void Timer::PostCallback() {
20 pp::CompletionCallback callback =
21 callback_factory_.NewCallback(&Timer::TimerProc);
22 pp::Module::Get()->core()->CallOnMainThread(delay_, callback, 0);
23 }
24
25 void Timer::TimerProc(int32_t /*result*/) {
26 PostCallback();
27 OnTimer();
28 }
29
30 } // namespace chrome_pdf
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698