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

Unified Diff: pdf/pdfium/pdfium_engine.cc

Issue 2554563002: [pdf] Reset defer_page_unload to original value. (Closed)
Patch Set: review feedback 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/pdfium/pdfium_engine.cc
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index 80f1fd6d9d709c33a890fb8064226b5e6979e3f1..f0ba08923cffe37077cd37b2bc7dfb4826c3be0a 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -12,6 +12,7 @@
#include <memory>
#include <set>
+#include "base/auto_reset.h"
#include "base/i18n/encoding_detection.h"
#include "base/i18n/icu_string_conversions.h"
#include "base/lazy_instance.h"
@@ -2470,9 +2471,8 @@ int PDFiumEngine::GetMostVisiblePage() {
// to defer the page deletion otherwise we could potentially delete the page
// that originated the calling JS request and destroy the objects that are
// currently being used.
- defer_page_unload_ = true;
+ base::AutoReset<bool> defer_page_unload_guard(&defer_page_unload_, true);
CalculateVisiblePages();
- defer_page_unload_ = false;
return most_visible_page_;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698