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

Side by Side Diff: chrome/browser/history/page_usage_data.cc

Issue 10673005: Removes unused thumbnail and favicon fields from PageUsageData. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
« no previous file with comments | « chrome/browser/history/page_usage_data.h ('k') | no next file » | 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) 2012 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/history/page_usage_data.h" 5 #include "chrome/browser/history/page_usage_data.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "third_party/skia/include/core/SkBitmap.h"
10
11 PageUsageData::PageUsageData(history::URLID id) 9 PageUsageData::PageUsageData(history::URLID id)
12 : id_(id), 10 : id_(id),
13 thumbnail_(NULL),
14 thumbnail_set_(false),
15 thumbnail_pending_(false),
16 favicon_(NULL),
17 favicon_set_(false),
18 favicon_pending_(false),
19 score_(0.0) { 11 score_(0.0) {
20 } 12 }
21 13
22 PageUsageData::~PageUsageData() { 14 PageUsageData::~PageUsageData() {
23 delete thumbnail_;
24 delete favicon_;
25 }
26
27 void PageUsageData::SetThumbnail(SkBitmap* img) {
28 if (thumbnail_ && thumbnail_ != img)
29 delete thumbnail_;
30
31 thumbnail_ = img;
32 thumbnail_set_ = true;
33 }
34
35 void PageUsageData::SetFavicon(SkBitmap* img) {
36 if (favicon_ && favicon_ != img)
37 delete favicon_;
38 favicon_ = img;
39 favicon_set_ = true;
40 } 15 }
41 16
42 // static 17 // static
43 bool PageUsageData::Predicate(const PageUsageData* lhs, 18 bool PageUsageData::Predicate(const PageUsageData* lhs,
44 const PageUsageData* rhs) { 19 const PageUsageData* rhs) {
45 return lhs->GetScore() > rhs->GetScore(); 20 return lhs->GetScore() > rhs->GetScore();
46 } 21 }
OLDNEW
« no previous file with comments | « chrome/browser/history/page_usage_data.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698