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

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

Issue 2601983002: [IndexedDB] Adding transaction and value support to observers (Closed)
Patch Set: Replying to comments, disallowed observing from versionchange txn Created 3 years, 11 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 void IDBDatabaseCallbacks::onComplete(int64_t transactionId) { 61 void IDBDatabaseCallbacks::onComplete(int64_t transactionId) {
62 if (m_database) 62 if (m_database)
63 m_database->onComplete(transactionId); 63 m_database->onComplete(transactionId);
64 } 64 }
65 65
66 void IDBDatabaseCallbacks::onChanges( 66 void IDBDatabaseCallbacks::onChanges(
67 const std::unordered_map<int32_t, std::vector<int32_t>>& 67 const std::unordered_map<int32_t, std::vector<int32_t>>&
68 observation_index_map, 68 observation_index_map,
69 const WebVector<WebIDBObservation>& observations) { 69 const WebVector<WebIDBObservation>& observations,
70 if (m_database) 70 const std::unordered_map<int32_t, std::pair<int64_t, std::vector<int64_t>>>&
71 m_database->onChanges(observation_index_map, observations); 71 transactions) {
72 if (!m_database)
73 return;
74
75 m_database->onChanges(observation_index_map, observations, transactions);
72 } 76 }
73 77
74 void IDBDatabaseCallbacks::connect(IDBDatabase* database) { 78 void IDBDatabaseCallbacks::connect(IDBDatabase* database) {
75 DCHECK(!m_database); 79 DCHECK(!m_database);
76 DCHECK(database); 80 DCHECK(database);
77 m_database = database; 81 m_database = database;
78 } 82 }
79 83
80 std::unique_ptr<WebIDBDatabaseCallbacks> 84 std::unique_ptr<WebIDBDatabaseCallbacks>
81 IDBDatabaseCallbacks::createWebCallbacks() { 85 IDBDatabaseCallbacks::createWebCallbacks() {
(...skipping 10 matching lines...) Expand all
92 m_webCallbacks = nullptr; 96 m_webCallbacks = nullptr;
93 } 97 }
94 } 98 }
95 99
96 void IDBDatabaseCallbacks::webCallbacksDestroyed() { 100 void IDBDatabaseCallbacks::webCallbacksDestroyed() {
97 DCHECK(m_webCallbacks); 101 DCHECK(m_webCallbacks);
98 m_webCallbacks = nullptr; 102 m_webCallbacks = nullptr;
99 } 103 }
100 104
101 } // namespace blink 105 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698