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

Side by Side Diff: third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp

Issue 2904603003: [IndexedDB] Adding txn, value, and key size metrics (Closed)
Patch Set: made sure size is 0'd out Created 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 HeapVector<IndexKeys> index_keys; 488 HeapVector<IndexKeys> index_keys;
489 for (const auto& it : Metadata().indexes) { 489 for (const auto& it : Metadata().indexes) {
490 if (clone.IsEmpty()) 490 if (clone.IsEmpty())
491 value_wrapper.Clone(script_state, &clone); 491 value_wrapper.Clone(script_state, &clone);
492 IndexKeys keys; 492 IndexKeys keys;
493 GenerateIndexKeysForValue(script_state->GetIsolate(), *it.value, clone, 493 GenerateIndexKeysForValue(script_state->GetIsolate(), *it.value, clone,
494 &keys); 494 &keys);
495 index_ids.push_back(it.key); 495 index_ids.push_back(it.key);
496 index_keys.push_back(keys); 496 index_keys.push_back(keys);
497 } 497 }
498 UMA_HISTOGRAM_MEMORY_KB("WebCore.IndexedDB.PutValueSize",
499 value_wrapper.DataLengthBeforeWrapInBytes() / 1024);
498 500
499 IDBRequest* request = 501 IDBRequest* request =
500 IDBRequest::Create(script_state, source, transaction_.Get()); 502 IDBRequest::Create(script_state, source, transaction_.Get());
501 503
502 value_wrapper.ExtractBlobDataHandles(request->transit_blob_handles()); 504 value_wrapper.ExtractBlobDataHandles(request->transit_blob_handles());
503 value_wrapper.WrapIfBiggerThan(IDBValueWrapper::kWrapThreshold); 505 value_wrapper.WrapIfBiggerThan(IDBValueWrapper::kWrapThreshold);
504 506
505 BackendDB()->Put( 507 BackendDB()->Put(
506 transaction_->Id(), Id(), WebData(value_wrapper.ExtractWireBytes()), 508 transaction_->Id(), Id(), WebData(value_wrapper.ExtractWireBytes()),
507 value_wrapper.WrappedBlobInfo(), key, 509 value_wrapper.WrappedBlobInfo(), key,
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 } 1052 }
1051 } 1053 }
1052 return IDBIndexMetadata::kInvalidId; 1054 return IDBIndexMetadata::kInvalidId;
1053 } 1055 }
1054 1056
1055 WebIDBDatabase* IDBObjectStore::BackendDB() const { 1057 WebIDBDatabase* IDBObjectStore::BackendDB() const {
1056 return transaction_->BackendDB(); 1058 return transaction_->BackendDB();
1057 } 1059 }
1058 1060
1059 } // namespace blink 1061 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698