| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_COMMON_THUMBNAIL_SCORE_H_ | 5 #ifndef CHROME_COMMON_THUMBNAIL_SCORE_H_ |
| 6 #define CHROME_COMMON_THUMBNAIL_SCORE_H_ | 6 #define CHROME_COMMON_THUMBNAIL_SCORE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // How bad a thumbnail needs to be before we completely ignore it. | 83 // How bad a thumbnail needs to be before we completely ignore it. |
| 84 static const double kThumbnailMaximumBoringness; | 84 static const double kThumbnailMaximumBoringness; |
| 85 | 85 |
| 86 // We consider a thumbnail interesting enough if the boring score is | 86 // We consider a thumbnail interesting enough if the boring score is |
| 87 // lower than this. | 87 // lower than this. |
| 88 static const double kThumbnailInterestingEnoughBoringness; | 88 static const double kThumbnailInterestingEnoughBoringness; |
| 89 | 89 |
| 90 // Time before we take a worse thumbnail (subject to | 90 // Time before we take a worse thumbnail (subject to |
| 91 // kThumbnailMaximumBoringness) over what's currently in the database | 91 // kThumbnailMaximumBoringness) over what's currently in the database |
| 92 // for freshness. | 92 // for freshness. |
| 93 static const base::TimeDelta kUpdateThumbnailTime; | 93 static const int64 kUpdateThumbnailTimeDays; |
| 94 | 94 |
| 95 // Penalty of how much more boring a thumbnail should be per hour. | 95 // Penalty of how much more boring a thumbnail should be per hour. |
| 96 static const double kThumbnailDegradePerHour; | 96 static const double kThumbnailDegradePerHour; |
| 97 | 97 |
| 98 // Checks whether we should consider updating a new thumbnail based on | 98 // Checks whether we should consider updating a new thumbnail based on |
| 99 // this score. For instance, we don't have to update a new thumbnail | 99 // this score. For instance, we don't have to update a new thumbnail |
| 100 // if the current thumbnail is new and interesting enough. | 100 // if the current thumbnail is new and interesting enough. |
| 101 bool ShouldConsiderUpdating(); | 101 bool ShouldConsiderUpdating(); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 // Checks whether we should replace one thumbnail with another. | 104 // Checks whether we should replace one thumbnail with another. |
| 105 bool ShouldReplaceThumbnailWith(const ThumbnailScore& current, | 105 bool ShouldReplaceThumbnailWith(const ThumbnailScore& current, |
| 106 const ThumbnailScore& replacement); | 106 const ThumbnailScore& replacement); |
| 107 | 107 |
| 108 #endif // CHROME_COMMON_THUMBNAIL_SCORE_H_ | 108 #endif // CHROME_COMMON_THUMBNAIL_SCORE_H_ |
| OLD | NEW |