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

Unified Diff: third_party/WebKit/Source/core/page/PrintContext.h

Issue 2864753004: M59: Clear the PrintContext in WebLocalFrameImpl::Close(). (Closed)
Patch Set: fix Created 3 years, 7 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: third_party/WebKit/Source/core/page/PrintContext.h
diff --git a/third_party/WebKit/Source/core/page/PrintContext.h b/third_party/WebKit/Source/core/page/PrintContext.h
index 6fdfd38055c27c33bb4782aebb668fdd6045fe03..218fc90a2eb9366a73b452a17495b68ed4e6c887 100644
--- a/third_party/WebKit/Source/core/page/PrintContext.h
+++ b/third_party/WebKit/Source/core/page/PrintContext.h
@@ -31,11 +31,11 @@
namespace blink {
class Element;
-class LocalFrame;
class FloatRect;
class FloatSize;
class GraphicsContext;
class IntRect;
+class LocalFrame;
class Node;
class CORE_EXPORT PrintContext
@@ -61,8 +61,6 @@ class CORE_EXPORT PrintContext
// Deprecated. Page size computation is already in this class, clients
// shouldn't be copying it.
- // FIXME: Everyone passes |false| for the second paramer. We should remove the
- // second parameter.
virtual void ComputePageRectsWithPageSize(
const FloatSize& page_size_in_pixels);
@@ -102,6 +100,8 @@ class CORE_EXPORT PrintContext
DECLARE_VIRTUAL_TRACE();
protected:
+ friend class PrintContextTest;
+
void OutputLinkedDestinations(GraphicsContext&, const IntRect& page_rect);
Member<LocalFrame> frame_;
@@ -111,6 +111,7 @@ class CORE_EXPORT PrintContext
void ComputePageRectsWithPageSizeInternal(
const FloatSize& page_size_in_pixels);
void CollectLinkedDestinations(Node*);
+ bool IsFrameValid() const;
// Used to prevent misuses of begin() and end() (e.g., call end without
// begin).
@@ -120,6 +121,21 @@ class CORE_EXPORT PrintContext
bool linked_destinations_valid_;
};
+class ScopedPrintContext {
+ STACK_ALLOCATED();
+
+ public:
+ explicit ScopedPrintContext(LocalFrame*);
+ ~ScopedPrintContext();
+
+ PrintContext* operator->() const { return context_.Get(); }
+
+ private:
+ Member<PrintContext> context_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedPrintContext);
+};
+
} // namespace blink
#endif
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp ('k') | third_party/WebKit/Source/core/page/PrintContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698