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

Unified Diff: ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h

Issue 7572031: Always call the class methods to save/restore contexts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ensure saving before context access Created 9 years, 4 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: ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h
diff --git a/ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h b/ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h
index 05bf5f660f38e9a58ba5d3b324a52e4db437a13e..e86a767cb75a33155d0bc407119ddd6c6addd25f 100644
--- a/ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h
+++ b/ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h
@@ -7,21 +7,17 @@
Mark Mentovai 2011/08/04 23:20:17 Add #pragma once.
Avi (use Gerrit) 2011/08/05 00:18:50 Done.
#include "ui/ui_api.h"
Mark Mentovai 2011/08/04 23:20:17 Sort headers: base < ui.
Avi (use Gerrit) 2011/08/05 00:18:50 Done.
#include "base/basictypes.h"
-#include "base/memory/scoped_nsobject.h"
@class NSGraphicsContext;
Mark Mentovai 2011/08/04 23:20:17 I would do: #if defined(__OBJC__) @class NSGraphi
Avi (use Gerrit) 2011/08/05 00:18:50 Removed; not needed.
namespace gfx {
+// A class to save/restore the state of the current context.
class UI_API ScopedNSGraphicsContextSaveGState {
public:
- // If |context| is nil, it will use the |+currentContext|.
- explicit ScopedNSGraphicsContextSaveGState(NSGraphicsContext* context = nil);
+ ScopedNSGraphicsContextSaveGState();
~ScopedNSGraphicsContextSaveGState();
- private:
- scoped_nsobject<NSGraphicsContext> context_;
Robert Sesek 2011/08/04 22:15:44 So if we were to be paranoid, we'd keep a weak ptr
Avi (use Gerrit) 2011/08/04 22:21:03 You mean before the save context and after the res
Robert Sesek 2011/08/04 22:22:13 No, it'd prevent changing the current context with
-
DISALLOW_COPY_AND_ASSIGN(ScopedNSGraphicsContextSaveGState);
Mark Mentovai 2011/08/04 23:20:17 This needs to be in a private: section.
Avi (use Gerrit) 2011/08/05 00:18:50 Done.
};

Powered by Google App Engine
This is Rietveld 408576698