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

Side by Side Diff: webkit/glue/image_resource_fetcher.cc

Issue 149295: Don't forget to free the callbacks! (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « webkit/glue/image_resource_fetcher.h ('k') | webkit/glue/resource_fetcher.h » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 #include "webkit/glue/image_resource_fetcher.h" 5 #include "webkit/glue/image_resource_fetcher.h"
6 6
7 #include "base/gfx/size.h" 7 #include "base/gfx/size.h"
8 #include "webkit/glue/image_decoder.h" 8 #include "webkit/glue/image_decoder.h"
9 #include "webkit/glue/webframe.h" 9 #include "webkit/glue/webframe.h"
10 #include "third_party/skia/include/core/SkBitmap.h" 10 #include "third_party/skia/include/core/SkBitmap.h"
(...skipping 27 matching lines...) Expand all
38 if (!response.isNull() && response.httpStatusCode() == 200) { 38 if (!response.isNull() && response.httpStatusCode() == 200) {
39 // Request succeeded, try to convert it to an image. 39 // Request succeeded, try to convert it to an image.
40 ImageDecoder decoder(gfx::Size(image_size_, image_size_)); 40 ImageDecoder decoder(gfx::Size(image_size_, image_size_));
41 bitmap = decoder.Decode( 41 bitmap = decoder.Decode(
42 reinterpret_cast<const unsigned char*>(data.data()), data.size()); 42 reinterpret_cast<const unsigned char*>(data.data()), data.size());
43 } // else case: 43 } // else case:
44 // If we get here, it means no image from server or couldn't decode the 44 // If we get here, it means no image from server or couldn't decode the
45 // response as an image. The delegate will see a null image, indicating 45 // response as an image. The delegate will see a null image, indicating
46 // that an error occurred. 46 // that an error occurred.
47 callback_->Run(this, bitmap); 47 callback_->Run(this, bitmap);
48 callback_.reset();
48 } 49 }
49 50
50 } // namespace webkit_glue 51 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/image_resource_fetcher.h ('k') | webkit/glue/resource_fetcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698