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

Side by Side Diff: pdf/instance.h

Issue 530363002: Prevent the in-process PDF plugin re-entering into JS during blink layout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | pdf/instance.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef PDF_INSTANCE_H_ 5 #ifndef PDF_INSTANCE_H_
6 #define PDF_INSTANCE_H_ 6 #define PDF_INSTANCE_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 195
196 // Helper functions for implementing PPP_PDF. 196 // Helper functions for implementing PPP_PDF.
197 void RotateClockwise(); 197 void RotateClockwise();
198 void RotateCounterclockwise(); 198 void RotateCounterclockwise();
199 199
200 private: 200 private:
201 // Called whenever the plugin geometry changes to update the location of the 201 // Called whenever the plugin geometry changes to update the location of the
202 // scrollbars, background parts, and notifies the pdf engine. 202 // scrollbars, background parts, and notifies the pdf engine.
203 void OnGeometryChanged(double old_zoom, float old_device_scale); 203 void OnGeometryChanged(double old_zoom, float old_device_scale);
204 204
205 // Runs the given JS callback given in |callback|.
206 void RunCallback(int32_t, pp::Var callback);
207
205 void CreateHorizontalScrollbar(); 208 void CreateHorizontalScrollbar();
206 void CreateVerticalScrollbar(); 209 void CreateVerticalScrollbar();
207 void DestroyHorizontalScrollbar(); 210 void DestroyHorizontalScrollbar();
208 void DestroyVerticalScrollbar(); 211 void DestroyVerticalScrollbar();
209 212
210 // Returns the thickness of a scrollbar. This returns the thickness when it's 213 // Returns the thickness of a scrollbar. This returns the thickness when it's
211 // shown, so for overlay scrollbars it'll still be non-zero. 214 // shown, so for overlay scrollbars it'll still be non-zero.
212 int GetScrollbarThickness(); 215 int GetScrollbarThickness();
213 216
214 // Returns the space we need to reserve for the scrollbar in the plugin area. 217 // Returns the space we need to reserve for the scrollbar in the plugin area.
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 uint32 delayed_progress_timer_id_; 452 uint32 delayed_progress_timer_id_;
450 PageIndicator page_indicator_; 453 PageIndicator page_indicator_;
451 454
452 // Used for creating images from numbers. 455 // Used for creating images from numbers.
453 scoped_ptr<NumberImageGenerator> number_image_generator_; 456 scoped_ptr<NumberImageGenerator> number_image_generator_;
454 457
455 // Used for submitting forms. 458 // Used for submitting forms.
456 pp::CompletionCallbackFactory<Instance> form_factory_; 459 pp::CompletionCallbackFactory<Instance> form_factory_;
457 pp::URLLoader form_loader_; 460 pp::URLLoader form_loader_;
458 461
459 // Used for printing without re-entrancy issues. 462 // Used for generating callbacks.
460 pp::CompletionCallbackFactory<Instance> print_callback_factory_; 463 // TODO(raymes): We don't really need other callback factories we can just
464 // fold them into this one.
465 pp::CompletionCallbackFactory<Instance> callback_factory_;
461 466
462 // True if we haven't painted the plugin viewport yet. 467 // True if we haven't painted the plugin viewport yet.
463 bool first_paint_; 468 bool first_paint_;
464 469
465 // True when we've painted at least one page from the document. 470 // True when we've painted at least one page from the document.
466 bool painted_first_page_; 471 bool painted_first_page_;
467 472
468 // True if we should display page indicator, false otherwise 473 // True if we should display page indicator, false otherwise
469 bool show_page_indicator_; 474 bool show_page_indicator_;
470 475
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
517 const std::vector<pp::Var>& args, 522 const std::vector<pp::Var>& args,
518 pp::Var* exception); 523 pp::Var* exception);
519 524
520 private: 525 private:
521 Instance* instance_; 526 Instance* instance_;
522 }; 527 };
523 528
524 } // namespace chrome_pdf 529 } // namespace chrome_pdf
525 530
526 #endif // PDF_INSTANCE_H_ 531 #endif // PDF_INSTANCE_H_
OLDNEW
« no previous file with comments | « no previous file | pdf/instance.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698