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

Side by Side Diff: chrome/browser/dom_ui/dom_ui_favicon_source.cc

Issue 288005: First fix to minimize copying of image data. (Closed)
Patch Set: Modify gyp Created 11 years, 2 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
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 "chrome/browser/dom_ui/dom_ui_favicon_source.h" 5 #include "chrome/browser/dom_ui/dom_ui_favicon_source.h"
6 6
7 #include "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "chrome/browser/profile.h" 8 #include "chrome/browser/profile.h"
9 #include "chrome/common/url_constants.h" 9 #include "chrome/common/url_constants.h"
10 #include "grit/app_resources.h" 10 #include "grit/app_resources.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 FaviconService* favicon_service = 47 FaviconService* favicon_service =
48 profile_->GetFaviconService(Profile::EXPLICIT_ACCESS); 48 profile_->GetFaviconService(Profile::EXPLICIT_ACCESS);
49 int request_id = cancelable_consumer_.GetClientData(favicon_service, 49 int request_id = cancelable_consumer_.GetClientData(favicon_service,
50 request_handle); 50 request_handle);
51 51
52 if (know_favicon && data.get() && !data->data.empty()) { 52 if (know_favicon && data.get() && !data->data.empty()) {
53 // Forward the data along to the networking system. 53 // Forward the data along to the networking system.
54 SendResponse(request_id, data); 54 SendResponse(request_id, data);
55 } else { 55 } else {
56 if (!default_favicon_.get()) { 56 if (!default_favicon_.get()) {
57 default_favicon_ = new RefCountedBytes; 57 default_favicon_ =
58 ResourceBundle::GetSharedInstance().LoadImageResourceBytes( 58 ResourceBundle::GetSharedInstance().LoadImageResourceBytes(
59 IDR_DEFAULT_FAVICON, &default_favicon_->data); 59 IDR_DEFAULT_FAVICON);
60 } 60 }
61 61
62 SendResponse(request_id, default_favicon_); 62 SendResponse(request_id, default_favicon_);
63 } 63 }
64 } 64 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698