summaryrefslogtreecommitdiffstats
path: root/chrome/default_plugin
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-05 23:27:11 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-05 23:27:11 +0000
commite5ffa33eb3ee71b9b44dc11ee80910b7b852b427 (patch)
tree84cb0771fb2a95d58183927b2f5db1941c74e82e /chrome/default_plugin
parent090f7313473bb61b6b294f1bfbb3b05f9140dec3 (diff)
downloadchromium_src-e5ffa33eb3ee71b9b44dc11ee80910b7b852b427.zip
chromium_src-e5ffa33eb3ee71b9b44dc11ee80910b7b852b427.tar.gz
chromium_src-e5ffa33eb3ee71b9b44dc11ee80910b7b852b427.tar.bz2
Always call the class methods to save/restore contexts.
If the current context was ever nil, sending a "restore" message would be a no-op and would likely leave an out-of-scope context as current. BUG=90140 TEST=repeatedly select items in an open file dialog in column mode; no crash Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=95611 Reverted: http://src.chromium.org/viewvc/chrome?view=rev&revision=95631 Review URL: http://codereview.chromium.org/7572031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95686 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/default_plugin')
-rw-r--r--chrome/default_plugin/plugin_impl_mac.mm6
1 files changed, 3 insertions, 3 deletions
diff --git a/chrome/default_plugin/plugin_impl_mac.mm b/chrome/default_plugin/plugin_impl_mac.mm
index eb0ee08..b6deb28 100644
--- a/chrome/default_plugin/plugin_impl_mac.mm
+++ b/chrome/default_plugin/plugin_impl_mac.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -17,6 +17,7 @@
#include "ui/base/l10n/l10n_util_mac.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
+#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
#include "unicode/locid.h"
#include "webkit/glue/webkit_glue.h"
#include "webkit/plugins/npapi/default_plugin_shared.h"
@@ -139,7 +140,7 @@ void PluginInstallerImpl::DownloadCancelled() {
}
int16 PluginInstallerImpl::OnDrawRect(CGContextRef context, CGRect dirty_rect) {
- [NSGraphicsContext saveGraphicsState];
+ gfx::ScopedNSGraphicsContextSaveGState scoped_state;
NSGraphicsContext* ns_context = [NSGraphicsContext
graphicsContextWithGraphicsPort:context flipped:YES];
[NSGraphicsContext setCurrentContext:ns_context];
@@ -183,7 +184,6 @@ int16 PluginInstallerImpl::OnDrawRect(CGContextRef context, CGRect dirty_rect) {
label_point = NSMakePoint(roundf(label_point.x), roundf(label_point.y));
[command_ drawAtPoint:label_point withAttributes:attributes];
- [NSGraphicsContext restoreGraphicsState];
return 1;
}