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

Side by Side Diff: chrome/browser/sync/glue/favicon_cache.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/sync/glue/favicon_cache.h" 5 #include "chrome/browser/sync/glue/favicon_cache.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "chrome/browser/favicon/favicon_service.h" 9 #include "chrome/browser/favicon/favicon_service.h"
10 #include "chrome/browser/favicon/favicon_service_factory.h" 10 #include "chrome/browser/favicon/favicon_service_factory.h"
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 page_favicon_map_[page_url] = icon_url; 531 page_favicon_map_[page_url] = icon_url;
532 532
533 // If there is no actual image, it means there either is no synced 533 // If there is no actual image, it means there either is no synced
534 // favicon, or it's on its way (race condition). 534 // favicon, or it's on its way (race condition).
535 // TODO(zea): potentially trigger a favicon web download here (delayed?). 535 // TODO(zea): potentially trigger a favicon web download here (delayed?).
536 if (icon_bytes.size() == 0) 536 if (icon_bytes.size() == 0)
537 return; 537 return;
538 538
539 // Post a task to do the actual association because this method may have been 539 // Post a task to do the actual association because this method may have been
540 // called while in a transaction. 540 // called while in a transaction.
541 MessageLoop::current()->PostTask( 541 base::MessageLoop::current()->PostTask(
542 FROM_HERE, 542 FROM_HERE,
543 base::Bind(&FaviconCache::OnReceivedSyncFaviconImpl, 543 base::Bind(&FaviconCache::OnReceivedSyncFaviconImpl,
544 weak_ptr_factory_.GetWeakPtr(), 544 weak_ptr_factory_.GetWeakPtr(),
545 icon_url, 545 icon_url,
546 icon_bytes, 546 icon_bytes,
547 visit_time_ms)); 547 visit_time_ms));
548 } 548 }
549 549
550 void FaviconCache::OnReceivedSyncFaviconImpl( 550 void FaviconCache::OnReceivedSyncFaviconImpl(
551 const GURL& icon_url, 551 const GURL& icon_url,
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
1020 1020
1021 size_t FaviconCache::NumFaviconsForTest() const { 1021 size_t FaviconCache::NumFaviconsForTest() const {
1022 return synced_favicons_.size(); 1022 return synced_favicons_.size();
1023 } 1023 }
1024 1024
1025 size_t FaviconCache::NumTasksForTest() const { 1025 size_t FaviconCache::NumTasksForTest() const {
1026 return page_task_map_.size(); 1026 return page_task_map_.size();
1027 } 1027 }
1028 1028
1029 } // namespace browser_sync 1029 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/data_type_manager_impl_unittest.cc ('k') | chrome/browser/sync/glue/favicon_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698