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

Side by Side Diff: pdf/timer.cc

Issue 2558573002: Revert "reland of Improve linearized pdf load/show time." (Closed)
Patch Set: Changes to make tests pass ... Created 4 years 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
« no previous file with comments | « pdf/timer.h ('k') | pdf/url_loader_wrapper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_in_milliseconds)
13 : delay_(delay_in_milliseconds), callback_factory_(this) {
14 PostCallback();
15 }
16
17 Timer::~Timer() {
18 }
19
20 void Timer::PostCallback() {
21 pp::CompletionCallback callback =
22 callback_factory_.NewCallback(&Timer::TimerProc);
23 pp::Module::Get()->core()->CallOnMainThread(delay_, callback, 0);
24 }
25
26 void Timer::TimerProc(int32_t /*result*/) {
27 PostCallback();
28 OnTimer();
29 }
30
31 } // namespace chrome_pdf
OLDNEW
« no previous file with comments | « pdf/timer.h ('k') | pdf/url_loader_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698