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

Side by Side Diff: chrome/browser/jumplist_win.cc

Issue 1372303002: Skip flushes on icon writes for 10x better jumplist perf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make the change for jumplists only Created 5 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
« no previous file with comments | « no previous file | ui/gfx/icon_util.h » ('j') | ui/gfx/icon_util.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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/jumplist_win.h" 5 #include "chrome/browser/jumplist_win.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // We don't have to care about the extension of this temporary file because 75 // We don't have to care about the extension of this temporary file because
76 // JumpList does not care about it. 76 // JumpList does not care about it.
77 base::FilePath path; 77 base::FilePath path;
78 if (!base::CreateTemporaryFileInDir(icon_dir, &path)) 78 if (!base::CreateTemporaryFileInDir(icon_dir, &path))
79 return false; 79 return false;
80 80
81 // Create an icon file from the favicon attached to the given |page|, and 81 // Create an icon file from the favicon attached to the given |page|, and
82 // save it as the temporary file. 82 // save it as the temporary file.
83 gfx::ImageFamily image_family; 83 gfx::ImageFamily image_family;
84 image_family.Add(gfx::Image::CreateFrom1xBitmap(bitmap)); 84 image_family.Add(gfx::Image::CreateFrom1xBitmap(bitmap));
85 if (!IconUtil::CreateIconFileFromImageFamily(image_family, path)) 85 if (!IconUtil::CreateIconFileFromImageFamily(image_family, path,
86 IconUtil::NORMAL_WRITE))
Alexei Svitkine (slow) 2015/09/30 21:26:23 Nit: {}'s
brucedawson 2015/09/30 22:13:59 Style guide says that {}'s are optional on single-
86 return false; 87 return false;
87 88
88 // Add this icon file to the list and return its absolute path. 89 // Add this icon file to the list and return its absolute path.
89 // The IShellLink::SetIcon() function needs the absolute path to an icon. 90 // The IShellLink::SetIcon() function needs the absolute path to an icon.
90 *icon_path = path; 91 *icon_path = path;
91 return true; 92 return true;
92 } 93 }
93 94
94 // Updates the "Tasks" category of the JumpList. 95 // Updates the "Tasks" category of the JumpList.
95 bool UpdateTaskCategory( 96 bool UpdateTaskCategory(
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 void JumpList::TopSitesLoaded(history::TopSites* top_sites) { 532 void JumpList::TopSitesLoaded(history::TopSites* top_sites) {
532 } 533 }
533 534
534 void JumpList::TopSitesChanged(history::TopSites* top_sites, 535 void JumpList::TopSitesChanged(history::TopSites* top_sites,
535 ChangeReason change_reason) { 536 ChangeReason change_reason) {
536 top_sites->GetMostVisitedURLs( 537 top_sites->GetMostVisitedURLs(
537 base::Bind(&JumpList::OnMostVisitedURLsAvailable, 538 base::Bind(&JumpList::OnMostVisitedURLsAvailable,
538 weak_ptr_factory_.GetWeakPtr()), 539 weak_ptr_factory_.GetWeakPtr()),
539 false); 540 false);
540 } 541 }
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/icon_util.h » ('j') | ui/gfx/icon_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698