1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_PENDING_CONNECTION_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_PENDING_CONNECTION_H_
7 
8 #include <stdint.h>
9 
10 #include "base/memory/ref_counted.h"
11 #include "base/memory/weak_ptr.h"
12 #include "content/browser/indexed_db/indexed_db_callbacks.h"
13 #include "content/browser/indexed_db/indexed_db_data_loss_info.h"
14 #include "content/browser/indexed_db/indexed_db_database_callbacks.h"
15 #include "content/common/content_export.h"
16 #include "url/origin.h"
17 
18 namespace content {
19 
20 class IndexedDBCallbacks;
21 class IndexedDBDatabaseCallbacks;
22 
23 struct CONTENT_EXPORT IndexedDBPendingConnection {
24   IndexedDBPendingConnection(
25       scoped_refptr<IndexedDBCallbacks> callbacks,
26       scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks,
27       int64_t transaction_id,
28       int64_t version,
29       base::OnceCallback<void(base::WeakPtr<IndexedDBTransaction>)>
30           create_transaction_callback);
31   ~IndexedDBPendingConnection();
32   scoped_refptr<IndexedDBCallbacks> callbacks;
33   scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks;
34   int64_t transaction_id;
35   int64_t version;
36   IndexedDBDataLossInfo data_loss_info;
37   base::OnceCallback<void(base::WeakPtr<IndexedDBTransaction>)>
38       create_transaction_callback;
39   base::WeakPtr<IndexedDBTransaction> transaction;
40   bool was_cold_open = false;
41 };
42 
43 }  // namespace content
44 
45 #endif  // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_PENDING_CONNECTION_H_
46