| Index: chrome/browser/dom_ui/dom_ui_favicon_source.cc
|
| diff --git a/chrome/browser/dom_ui/dom_ui_favicon_source.cc b/chrome/browser/dom_ui/dom_ui_favicon_source.cc
|
| index f80aa70b4130a844c91bc43ebb02a7c5fa73e47c..d6585034ea6bdafeb0df3f45ad876eb17631fb29 100644
|
| --- a/chrome/browser/dom_ui/dom_ui_favicon_source.cc
|
| +++ b/chrome/browser/dom_ui/dom_ui_favicon_source.cc
|
| @@ -1,4 +1,4 @@
|
| -// Copyright (c) 2009 The Chromium Authors. All rights reserved.
|
| +// Copyright (c) 2010 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.
|
|
|
| @@ -6,6 +6,7 @@
|
|
|
| #include "app/resource_bundle.h"
|
| #include "base/callback.h"
|
| +#include "chrome/browser/chrome_thread.h"
|
| #include "chrome/browser/profile.h"
|
| #include "chrome/common/url_constants.h"
|
| #include "grit/app_resources.h"
|
| @@ -15,9 +16,14 @@ DOMUIFavIconSource::DOMUIFavIconSource(Profile* profile)
|
| profile_(profile) {
|
| }
|
|
|
| +DOMUIFavIconSource::~DOMUIFavIconSource() {
|
| + DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
|
| +}
|
| +
|
| void DOMUIFavIconSource::StartDataRequest(const std::string& path,
|
| bool is_off_the_record,
|
| int request_id) {
|
| + DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
|
| FaviconService* favicon_service =
|
| profile_->GetFaviconService(Profile::EXPLICIT_ACCESS);
|
| if (favicon_service) {
|
| @@ -40,12 +46,19 @@ void DOMUIFavIconSource::StartDataRequest(const std::string& path,
|
| }
|
| }
|
|
|
| +std::string DOMUIFavIconSource::GetMimeType(const std::string&) const {
|
| + // We need to explicitly return a mime type, otherwise if the user tries to
|
| + // drag the image they get no extension.
|
| + return "image/png";
|
| +}
|
| +
|
| void DOMUIFavIconSource::OnFavIconDataAvailable(
|
| FaviconService::Handle request_handle,
|
| bool know_favicon,
|
| scoped_refptr<RefCountedMemory> data,
|
| bool expired,
|
| GURL icon_url) {
|
| + DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
|
| FaviconService* favicon_service =
|
| profile_->GetFaviconService(Profile::EXPLICIT_ACCESS);
|
| int request_id = cancelable_consumer_.GetClientData(favicon_service,
|
|
|