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

Side by Side Diff: chrome/browser/history/thumbnail_database.h

Issue 10917041: Cleanup FaviconSQLHandler::Update (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_HISTORY_THUMBNAIL_DATABASE_H_ 5 #ifndef CHROME_BROWSER_HISTORY_THUMBNAIL_DATABASE_H_
6 #define CHROME_BROWSER_HISTORY_THUMBNAIL_DATABASE_H_ 6 #define CHROME_BROWSER_HISTORY_THUMBNAIL_DATABASE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/gtest_prod_util.h" 10 #include "base/gtest_prod_util.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 FaviconID GetFaviconIDForFaviconURL(const GURL& icon_url, 142 FaviconID GetFaviconIDForFaviconURL(const GURL& icon_url,
143 int required_icon_type, 143 int required_icon_type,
144 IconType* icon_type); 144 IconType* icon_type);
145 145
146 // Gets the icon_url, icon_type and sizes for the specified |icon_id|. 146 // Gets the icon_url, icon_type and sizes for the specified |icon_id|.
147 bool GetFaviconHeader(FaviconID icon_id, 147 bool GetFaviconHeader(FaviconID icon_id,
148 GURL* icon_url, 148 GURL* icon_url,
149 IconType* icon_type, 149 IconType* icon_type,
150 FaviconSizes* favicon_sizes); 150 FaviconSizes* favicon_sizes);
151 151
152 // Adds favicon with |icon_url| and |icon_type| to the favicon db, returning 152 // Adds favicon with |icon_url|, |icon_type| and |favicon_sizes| to the
153 // its id. 153 // favicon db, returning its id.
154 FaviconID AddFavicon(const GURL& icon_url, IconType icon_type); 154 FaviconID AddFavicon(const GURL& icon_url,
155 IconType icon_type,
156 const FaviconSizes& favicon_sizes);
155 157
156 // Adds a favicon with a single bitmap. This call is equivalent to calling 158 // Adds a favicon with a single bitmap. This call is equivalent to calling
157 // AddFavicon, SetFaviconSizes, and AddFaviconBitmap. 159 // AddFavicon and AddFaviconBitmap.
158 FaviconID AddFavicon(const GURL& icon_url, 160 FaviconID AddFavicon(const GURL& icon_url,
159 IconType icon_type, 161 IconType icon_type,
160 const FaviconSizes& favicon_sizes, 162 const FaviconSizes& favicon_sizes,
161 const scoped_refptr<base::RefCountedMemory>& icon_data, 163 const scoped_refptr<base::RefCountedMemory>& icon_data,
162 base::Time time, 164 base::Time time,
163 const gfx::Size& pixel_size); 165 const gfx::Size& pixel_size);
164 166
165 // Delete the favicon with the provided id. Returns false on failure 167 // Delete the favicon with the provided id. Returns false on failure
166 bool DeleteFavicon(FaviconID id); 168 bool DeleteFavicon(FaviconID id);
167 169
(...skipping 27 matching lines...) Expand all
195 197
196 // Updates the page and icon mapping for the given mapping_id with the given 198 // Updates the page and icon mapping for the given mapping_id with the given
197 // icon_id. 199 // icon_id.
198 // Returns true if the update succeeded. 200 // Returns true if the update succeeded.
199 bool UpdateIconMapping(IconMappingID mapping_id, FaviconID icon_id); 201 bool UpdateIconMapping(IconMappingID mapping_id, FaviconID icon_id);
200 202
201 // Deletes the icon mapping entries for the given page url. 203 // Deletes the icon mapping entries for the given page url.
202 // Returns true if the deletion succeeded. 204 // Returns true if the deletion succeeded.
203 bool DeleteIconMappings(const GURL& page_url); 205 bool DeleteIconMappings(const GURL& page_url);
204 206
207 // Deletes the icon mapping with |mapping_id|.
208 // Returns true if the deletion succeeded.
209 bool DeleteIconMapping(IconMappingID mapping_id);
210
205 // Checks whether a favicon is used by any URLs in the database. 211 // Checks whether a favicon is used by any URLs in the database.
206 bool HasMappingFor(FaviconID id); 212 bool HasMappingFor(FaviconID id);
207 213
208 // Clones the existing mappings from |old_page_url| if |new_page_url| has no 214 // Clones the existing mappings from |old_page_url| if |new_page_url| has no
209 // mappings. Otherwise, will leave mappings alone. 215 // mappings. Otherwise, will leave mappings alone.
210 bool CloneIconMappings(const GURL& old_page_url, const GURL& new_page_url); 216 bool CloneIconMappings(const GURL& old_page_url, const GURL& new_page_url);
211 217
212 // The class to enumerate icon mappings. Use InitIconMappingEnumerator to 218 // The class to enumerate icon mappings. Use InitIconMappingEnumerator to
213 // initialize. 219 // initialize.
214 class IconMappingEnumerator { 220 class IconMappingEnumerator {
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 const HistoryPublisher* history_publisher_; 385 const HistoryPublisher* history_publisher_;
380 386
381 // True if migration to TopSites has been done and the thumbnails 387 // True if migration to TopSites has been done and the thumbnails
382 // table should not be used. 388 // table should not be used.
383 bool use_top_sites_; 389 bool use_top_sites_;
384 }; 390 };
385 391
386 } // namespace history 392 } // namespace history
387 393
388 #endif // CHROME_BROWSER_HISTORY_THUMBNAIL_DATABASE_H_ 394 #endif // CHROME_BROWSER_HISTORY_THUMBNAIL_DATABASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698