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

Side by Side Diff: Source/modules/indexeddb/IDBDatabase.cpp

Issue 235933013: Add the backchannel for Blobs to be received into Blink from the database backend. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rolled in feedback Created 6 years, 8 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 | Annotate | Revision Log
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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 } 92 }
93 93
94 int64_t IDBDatabase::nextTransactionId() 94 int64_t IDBDatabase::nextTransactionId()
95 { 95 {
96 // Only keep a 32-bit counter to allow ports to use the other 32 96 // Only keep a 32-bit counter to allow ports to use the other 32
97 // bits of the id. 97 // bits of the id.
98 AtomicallyInitializedStatic(int, currentTransactionId = 0); 98 AtomicallyInitializedStatic(int, currentTransactionId = 0);
99 return atomicIncrement(&currentTransactionId); 99 return atomicIncrement(&currentTransactionId);
100 } 100 }
101 101
102 void IDBDatabase::ackReceivedBlobs(const Vector<blink::WebBlobInfo>* blobInfo)
103 {
104 ASSERT(blobInfo);
105 if (!blobInfo->size() || !m_backend)
106 return;
107 Vector<blink::WebBlobInfo>::const_iterator iter;
108 Vector<String> uuids;
109 uuids.reserveCapacity(blobInfo->size());
110 for (iter = blobInfo->begin(); iter != blobInfo->end(); ++iter)
111 uuids.append(iter->uuid());
112 m_backend->ackReceivedBlobs(uuids);
113 }
114
102 void IDBDatabase::indexCreated(int64_t objectStoreId, const IDBIndexMetadata& me tadata) 115 void IDBDatabase::indexCreated(int64_t objectStoreId, const IDBIndexMetadata& me tadata)
103 { 116 {
104 IDBDatabaseMetadata::ObjectStoreMap::iterator it = m_metadata.objectStores.f ind(objectStoreId); 117 IDBDatabaseMetadata::ObjectStoreMap::iterator it = m_metadata.objectStores.f ind(objectStoreId);
105 ASSERT_WITH_SECURITY_IMPLICATION(it != m_metadata.objectStores.end()); 118 ASSERT_WITH_SECURITY_IMPLICATION(it != m_metadata.objectStores.end());
106 it->value.indexes.set(metadata.id, metadata); 119 it->value.indexes.set(metadata.id, metadata);
107 } 120 }
108 121
109 void IDBDatabase::indexDeleted(int64_t objectStoreId, int64_t indexId) 122 void IDBDatabase::indexDeleted(int64_t objectStoreId, int64_t indexId)
110 { 123 {
111 IDBDatabaseMetadata::ObjectStoreMap::iterator it = m_metadata.objectStores.f ind(objectStoreId); 124 IDBDatabaseMetadata::ObjectStoreMap::iterator it = m_metadata.objectStores.f ind(objectStoreId);
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 { 436 {
424 return EventTargetNames::IDBDatabase; 437 return EventTargetNames::IDBDatabase;
425 } 438 }
426 439
427 ExecutionContext* IDBDatabase::executionContext() const 440 ExecutionContext* IDBDatabase::executionContext() const
428 { 441 {
429 return ActiveDOMObject::executionContext(); 442 return ActiveDOMObject::executionContext();
430 } 443 }
431 444
432 } // namespace WebCore 445 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698