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

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

Issue 2694283002: IndexedDB: Added external memory counting for IDBValue. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/indexeddb/IDBValue.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 } 387 }
388 388
389 // Deserialize just the value data & blobInfo from the given IDBValue. 389 // Deserialize just the value data & blobInfo from the given IDBValue.
390 // Does not deserialize the key & keypath. 390 // Does not deserialize the key & keypath.
391 static v8::Local<v8::Value> deserializeIDBValueData(v8::Isolate* isolate, 391 static v8::Local<v8::Value> deserializeIDBValueData(v8::Isolate* isolate,
392 const IDBValue* value) { 392 const IDBValue* value) {
393 ASSERT(isolate->InContext()); 393 ASSERT(isolate->InContext());
394 if (!value || value->isNull()) 394 if (!value || value->isNull())
395 return v8::Null(isolate); 395 return v8::Null(isolate);
396 396
397 const SharedBuffer* valueData = value->data();
398 RefPtr<SerializedScriptValue> serializedValue = 397 RefPtr<SerializedScriptValue> serializedValue =
399 SerializedScriptValue::create(valueData->data(), valueData->size()); 398 value->createSerializedValue();
400 return serializedValue->deserialize(isolate, nullptr, value->blobInfo()); 399 return serializedValue->deserialize(isolate, nullptr, value->blobInfo());
401 } 400 }
402 401
403 // Deserialize the entire IDBValue (injecting key & keypath if present). 402 // Deserialize the entire IDBValue (injecting key & keypath if present).
404 static v8::Local<v8::Value> deserializeIDBValue( 403 static v8::Local<v8::Value> deserializeIDBValue(
405 v8::Isolate* isolate, 404 v8::Isolate* isolate,
406 v8::Local<v8::Object> creationContext, 405 v8::Local<v8::Object> creationContext,
407 const IDBValue* value) { 406 const IDBValue* value) {
408 ASSERT(isolate->InContext()); 407 ASSERT(isolate->InContext());
409 if (!value || value->isNull()) 408 if (!value || value->isNull())
(...skipping 207 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/indexeddb/IDBValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698