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

Side by Side Diff: chrome/browser/themes/browser_theme_pack.cc

Issue 1811803002: kThemePackVersion comment should mention theme cache flushing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase against ToT. Created 4 years, 9 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 | 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) 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 #include "chrome/browser/themes/browser_theme_pack.h" 5 #include "chrome/browser/themes/browser_theme_pack.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 30 matching lines...) Expand all
41 #include "ui/gfx/skia_util.h" 41 #include "ui/gfx/skia_util.h"
42 #include "ui/resources/grit/ui_resources.h" 42 #include "ui/resources/grit/ui_resources.h"
43 43
44 using content::BrowserThread; 44 using content::BrowserThread;
45 using extensions::Extension; 45 using extensions::Extension;
46 46
47 namespace { 47 namespace {
48 48
49 // Version number of the current theme pack. We just throw out and rebuild 49 // Version number of the current theme pack. We just throw out and rebuild
50 // theme packs that aren't int-equal to this. Increment this number if you 50 // theme packs that aren't int-equal to this. Increment this number if you
51 // change default theme assets. 51 // change default theme assets or if you need themes to recreate their generated
52 // images (which are cached).
52 const int kThemePackVersion = 41; 53 const int kThemePackVersion = 41;
53 54
54 // IDs that are in the DataPack won't clash with the positive integer 55 // IDs that are in the DataPack won't clash with the positive integer
55 // uint16_t. kHeaderID should always have the maximum value because we want the 56 // uint16_t. kHeaderID should always have the maximum value because we want the
56 // "header" to be written last. That way we can detect whether the pack was 57 // "header" to be written last. That way we can detect whether the pack was
57 // successfully written and ignore and regenerate if it was only partially 58 // successfully written and ignore and regenerate if it was only partially
58 // written (i.e. chrome crashed on a different thread while writing the pack). 59 // written (i.e. chrome crashed on a different thread while writing the pack).
59 const int kMaxID = 0x0000FFFF; // Max unsigned 16-bit int. 60 const int kMaxID = 0x0000FFFF; // Max unsigned 16-bit int.
60 const int kHeaderID = kMaxID - 1; 61 const int kHeaderID = kMaxID - 1;
61 const int kTintsID = kMaxID - 2; 62 const int kTintsID = kMaxID - 2;
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after
1542 false, 1543 false,
1543 &bitmap_data)) { 1544 &bitmap_data)) {
1544 NOTREACHED() << "Unable to encode theme image for prs_id=" 1545 NOTREACHED() << "Unable to encode theme image for prs_id="
1545 << prs_id << " for scale_factor=" << scale_factors_[i]; 1546 << prs_id << " for scale_factor=" << scale_factors_[i];
1546 break; 1547 break;
1547 } 1548 }
1548 image_memory_[scaled_raw_id] = 1549 image_memory_[scaled_raw_id] =
1549 base::RefCountedBytes::TakeVector(&bitmap_data); 1550 base::RefCountedBytes::TakeVector(&bitmap_data);
1550 } 1551 }
1551 } 1552 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698