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

Unified Diff: pdf/timer.h

Issue 2349753003: Improve linearized pdf load/show time. (Closed)
Patch Set: fix review issues and compilation. Created 4 years, 2 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
Index: pdf/timer.h
diff --git a/pdf/timer.h b/pdf/timer.h
new file mode 100644
index 0000000000000000000000000000000000000000..49b50689cccc3fc466abe068d653532d8a5b4fc4
--- /dev/null
+++ b/pdf/timer.h
@@ -0,0 +1,35 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PDF_TIMER_H_
+#define PDF_TIMER_H_
+
+#include "base/macros.h"
+#include "ppapi/utility/completion_callback_factory.h"
+
+namespace chrome_pdf {
+
+// Timer implementation for pepper plugins, based on pp::Core::CallOnMainThread.
+// We can not use base::Timer for plugins, because they have not
Lei Zhang 2016/10/25 19:40:37 grammar: they have no base::MessageLoop
snake 2016/10/25 20:07:17 Done.
+// base::MessageLoop, on which it is based.
+class Timer {
+ public:
+ explicit Timer(int delay_in_milliseconds);
+ virtual ~Timer();
+
+ virtual void OnTimer() = 0;
+
+ private:
+ void PostCallback();
+ void TimerProc(int32_t result);
+
+ int delay_;
+ pp::CompletionCallbackFactory<Timer> callback_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(Timer);
+};
+
+} // namespace chrome_pdf
+
+#endif // PDF_TIMER_H_
« pdf/document_loader.h ('K') | « pdf/run_all_unittests.cc ('k') | pdf/timer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698