diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-10 09:25:34 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-10 09:25:34 +0000 |
commit | f6755a283e00b70d557147f4a213f99835fdea9f (patch) | |
tree | 1118d4e1ad61dcb3912fd259fa806546702f4cc8 /chrome/browser/jumplist.cc | |
parent | 7ea0a6112b5110feb4b02d22dae6b7d2994d38a7 (diff) | |
download | chromium_src-f6755a283e00b70d557147f4a213f99835fdea9f.zip chromium_src-f6755a283e00b70d557147f4a213f99835fdea9f.tar.gz chromium_src-f6755a283e00b70d557147f4a213f99835fdea9f.tar.bz2 |
A blind fix for Issue 18837 (and a build fix for VS2008)
To read this crash dump, this issue is caused by my mistake that this jumplist.cc calls "icon_urls_.front()" for an empty list.
This change added some checks that verifies a std::list has one or more items.
This change also fixes linker errors because of conflicted symbols: CLSID_DestinationList and CLSID_EnumerableObjectCollection, which is caused by my mistake that I forgot removing "EXTERN_C" keywords when I moved them into an anonymous namespace. This change removes the "EXTERN_C" keywords for VS2008.
BUG=18837 "Crash - JumpList::OnFavIconDataAvailable(int,bool,scoped_refptr<RefCountedVector<unsigned char> >,bool,GURL)"
TEST=Show JumpList on Windows 7.
TEST=Build Chromium with VS2008.
Review URL: http://codereview.chromium.org/159853
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22907 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/jumplist.cc')
-rw-r--r-- | chrome/browser/jumplist.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/chrome/browser/jumplist.cc b/chrome/browser/jumplist.cc index fcf39e6..81342aa 100644 --- a/chrome/browser/jumplist.cc +++ b/chrome/browser/jumplist.cc @@ -109,14 +109,14 @@ ICustomDestinationList : public IUnknown { #endif // __ICustomDestinationList_INTERFACE_DEFINED__ // Class IDs used in this file. -// These class IDs should be defined in an anonymous namespace to avoid -// potential conflicts with ones defined in "shell32.lib" of Microsoft SDK 7.0. +// These class IDs must be defined in an anonymous namespace to avoid +// conflicts with ones defined in "shell32.lib" of Visual Studio 2008. // TODO(hbono): Bug 16903: to be deleted them when we use Windows SDK 7.0. -EXTERN_C const CLSID CLSID_DestinationList = { +const CLSID CLSID_DestinationList = { 0x77f10cf0, 0x3db5, 0x4966, {0xb5, 0x20, 0xb7, 0xc5, 0x4f, 0xd3, 0x5e, 0xd6} }; -EXTERN_C const CLSID CLSID_EnumerableObjectCollection = { +const CLSID CLSID_EnumerableObjectCollection = { 0x2d3468c1, 0x36a7, 0x43b6, {0xac, 0x24, 0xd3, 0xf0, 0x2f, 0xd9, 0x60, 0x7a} }; @@ -712,11 +712,14 @@ void JumpList::OnFavIconDataAvailable( GURL icon_url) { // Attach the received data to the ShellLinkItem object. // This data will be decoded by JumpListUpdateTask. - if (know_favicon && data.get() && !data->data.empty()) - icon_urls_.front().second->SetIconData(data); + if (know_favicon && data.get() && !data->data.empty()) { + if (!icon_urls_.empty() && icon_urls_.front().second) + icon_urls_.front().second->SetIconData(data); + } // if we need to load more fav icons, we send another query and exit. - icon_urls_.pop_front(); + if (!icon_urls_.empty()) + icon_urls_.pop_front(); if (StartLoadingFavIcon()) return; |