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

Side by Side Diff: components/enhanced_bookmarks/test_image_store.cc

Issue 1546143002: Switch to standard integer types in components/, part 1 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "components/enhanced_bookmarks/test_image_store.h" 5 #include "components/enhanced_bookmarks/test_image_store.h"
6 6
7 #include "third_party/skia/include/core/SkBitmap.h" 7 #include "third_party/skia/include/core/SkBitmap.h"
8 #include "ui/gfx/geometry/size.h" 8 #include "ui/gfx/geometry/size.h"
9 #include "url/gurl.h" 9 #include "url/gurl.h"
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 for (ImageMap::const_iterator it = store_.begin(); it != store_.end(); ++it) 61 for (ImageMap::const_iterator it = store_.begin(); it != store_.end(); ++it)
62 urls->insert(it->first); 62 urls->insert(it->first);
63 } 63 }
64 64
65 void TestImageStore::ClearAll() { 65 void TestImageStore::ClearAll() {
66 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); 66 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
67 67
68 store_.clear(); 68 store_.clear();
69 } 69 }
70 70
71 int64 TestImageStore::GetStoreSizeInBytes() { 71 int64_t TestImageStore::GetStoreSizeInBytes() {
72 // Not 100% accurate, but it's for testing so the actual value is not 72 // Not 100% accurate, but it's for testing so the actual value is not
73 // important. 73 // important.
74 int64 size = sizeof(store_); 74 int64_t size = sizeof(store_);
75 for (ImageMap::const_iterator it = store_.begin(); it != store_.end(); ++it) { 75 for (ImageMap::const_iterator it = store_.begin(); it != store_.end(); ++it) {
76 size += sizeof(it->first); 76 size += sizeof(it->first);
77 size += it->first.spec().length(); 77 size += it->first.spec().length();
78 size += sizeof(it->second); 78 size += sizeof(it->second);
79 SkBitmap bitmap = it->second->image->AsBitmap(); 79 SkBitmap bitmap = it->second->image->AsBitmap();
80 size += bitmap.getSize(); 80 size += bitmap.getSize();
81 size += it->second->url.spec().length(); 81 size += it->second->url.spec().length();
82 size += sizeof(it->second->dominant_color); 82 size += sizeof(it->second->dominant_color);
83 } 83 }
84 return size; 84 return size;
85 } 85 }
86 86
87 TestImageStore::~TestImageStore() { 87 TestImageStore::~TestImageStore() {
88 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); 88 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
89 } 89 }
OLDNEW
« no previous file with comments | « components/enhanced_bookmarks/test_image_store.h ('k') | components/error_page/renderer/net_error_helper_core.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698