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

Side by Side Diff: third_party/WebKit/Source/bindings/modules/v8/V8BindingForModules.cpp

Issue 2676403003: IndexedDB: Add histograms for key type (Closed)
Patch Set: Record index key types too Created 3 years, 10 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // values as undefined, rather than the more typical (for DOM) null. 89 // values as undefined, rather than the more typical (for DOM) null.
90 // This appears on the |upper| and |lower| attributes of IDBKeyRange. 90 // This appears on the |upper| and |lower| attributes of IDBKeyRange.
91 // Spec: http://www.w3.org/TR/IndexedDB/#idl-def-IDBKeyRange 91 // Spec: http://www.w3.org/TR/IndexedDB/#idl-def-IDBKeyRange
92 return v8Undefined(); 92 return v8Undefined();
93 } 93 }
94 94
95 v8::Local<v8::Context> context = isolate->GetCurrentContext(); 95 v8::Local<v8::Context> context = isolate->GetCurrentContext();
96 96
97 switch (key->getType()) { 97 switch (key->getType()) {
98 case IDBKey::InvalidType: 98 case IDBKey::InvalidType:
99 case IDBKey::MinType:
100 ASSERT_NOT_REACHED(); 99 ASSERT_NOT_REACHED();
101 return v8Undefined(); 100 return v8Undefined();
102 case IDBKey::NumberType: 101 case IDBKey::NumberType:
103 return v8::Number::New(isolate, key->number()); 102 return v8::Number::New(isolate, key->number());
104 case IDBKey::StringType: 103 case IDBKey::StringType:
105 return v8String(isolate, key->string()); 104 return v8String(isolate, key->string());
106 case IDBKey::BinaryType: 105 case IDBKey::BinaryType:
107 // Experimental feature: binary keys 106 // Experimental feature: binary keys
108 // https://w3c.github.io/IndexedDB/#steps-to-convert-a-key-to-a-value 107 // https://w3c.github.io/IndexedDB/#steps-to-convert-a-key-to-a-value
109 return ToV8(DOMArrayBuffer::create(reinterpret_cast<const unsigned char*>( 108 return ToV8(DOMArrayBuffer::create(reinterpret_cast<const unsigned char*>(
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 if (expectedKey && expectedKey->isEqual(value->primaryKey())) 616 if (expectedKey && expectedKey->isEqual(value->primaryKey()))
618 return; 617 return;
619 618
620 bool injected = injectV8KeyIntoV8Value( 619 bool injected = injectV8KeyIntoV8Value(
621 isolate, keyValue.v8Value(), scriptValue.v8Value(), value->keyPath()); 620 isolate, keyValue.v8Value(), scriptValue.v8Value(), value->keyPath());
622 DCHECK(injected); 621 DCHECK(injected);
623 } 622 }
624 #endif 623 #endif
625 624
626 } // namespace blink 625 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698