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

Unified Diff: base/gfx/vector_canvas.cc

Issue 9459: Make canvas code a bit more resilient to crashes.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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 | « base/gfx/vector_canvas.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/gfx/vector_canvas.cc
===================================================================
--- base/gfx/vector_canvas.cc (revision 4621)
+++ base/gfx/vector_canvas.cc (working copy)
@@ -13,16 +13,21 @@
}
VectorCanvas::VectorCanvas(HDC dc, int width, int height) {
- initialize(dc, width, height);
+ bool initialized = initialize(dc, width, height);
+ CHECK(initialized);
}
VectorCanvas::~VectorCanvas() {
}
-void VectorCanvas::initialize(HDC context, int width, int height) {
+bool VectorCanvas::initialize(HDC context, int width, int height) {
SkDevice* device = createPlatformDevice(width, height, true, context);
+ if (!device)
+ return false;
+
setDevice(device);
device->unref(); // was created with refcount 1, and setDevice also refs
+ return true;
}
SkBounder* VectorCanvas::setBounder(SkBounder* bounder) {
« no previous file with comments | « base/gfx/vector_canvas.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698