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

Unified Diff: chrome/browser/extensions/api/extension_action/extension_actions_api.cc

Issue 10837215: exhibit 1: explicit null checks Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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
« no previous file with comments | « no previous file | chrome/browser/favicon/favicon_tab_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/extension_action/extension_actions_api.cc
diff --git a/chrome/browser/extensions/api/extension_action/extension_actions_api.cc b/chrome/browser/extensions/api/extension_action/extension_actions_api.cc
index 7b4cd1f1ec81085d8d53513249ccdd3b1fce8854..5dda96382d07c65cef10b18abab3c86c9a3717ef 100644
--- a/chrome/browser/extensions/api/extension_action/extension_actions_api.cc
+++ b/chrome/browser/extensions/api/extension_action/extension_actions_api.cc
@@ -73,7 +73,8 @@ bool StringToSkBitmap(const std::string& str, SkBitmap* bitmap) {
// Conversion function for reading/writing to storage.
std::string ImageToString(const gfx::Image& image) {
IPC::Message bitmap_pickle;
- IPC::WriteParam(&bitmap_pickle, image.AsBitmap());
+ IPC::WriteParam(&bitmap_pickle,
+ image.IsEmpty() ? SkBitmap() : *image.ToSkBitmap());
std::string raw_str(static_cast<const char*>(bitmap_pickle.data()),
bitmap_pickle.size());
std::string base64_str;
« no previous file with comments | « no previous file | chrome/browser/favicon/favicon_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698