Commit aca8ba5b authored by gangwu's avatar gangwu Committed by Commit bot

Use server-side ModelTypeCount when it did not apply yet.

BUG=571488

Review URL: https://codereview.chromium.org/1554443002

Cr-Commit-Position: refs/heads/master@{#367023}
parent 0866e86f
......@@ -656,7 +656,7 @@ bool DirectoryBackingStore::LoadEntries(Directory::MetahandlesMap* handles_map,
select.append(" FROM metas");
int total_specifics_copies = 0;
int model_type_entry_count[MODEL_TYPE_COUNT];
for (int i = FIRST_REAL_MODEL_TYPE; i < MODEL_TYPE_COUNT; ++i) {
for (int i = 0; i < MODEL_TYPE_COUNT; ++i) {
model_type_entry_count[i] = 0;
}
......@@ -672,7 +672,11 @@ bool DirectoryBackingStore::LoadEntries(Directory::MetahandlesMap* handles_map,
if (SafeToPurgeOnLoading(*kernel)) {
metahandles_to_purge->insert(handle);
} else {
++model_type_entry_count[kernel->GetModelType()];
ModelType model_type = kernel->GetModelType();
if (!IsRealDataType(model_type)) {
model_type = kernel->GetServerModelType();
}
++model_type_entry_count[model_type];
(*handles_map)[handle] = kernel.release();
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment