Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 struct IndexedDBValue; | 33 struct IndexedDBValue; |
| 34 | 34 |
| 35 class CONTENT_EXPORT IndexedDBCallbacks | 35 class CONTENT_EXPORT IndexedDBCallbacks |
| 36 : public base::RefCounted<IndexedDBCallbacks> { | 36 : public base::RefCounted<IndexedDBCallbacks> { |
| 37 public: | 37 public: |
| 38 // Destructively converts an IndexedDBValue to a Mojo Value. | 38 // Destructively converts an IndexedDBValue to a Mojo Value. |
| 39 static ::indexed_db::mojom::ValuePtr ConvertAndEraseValue( | 39 static ::indexed_db::mojom::ValuePtr ConvertAndEraseValue( |
| 40 IndexedDBValue* value); | 40 IndexedDBValue* value); |
| 41 | 41 |
| 42 IndexedDBCallbacks( | 42 IndexedDBCallbacks( |
| 43 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host, | 43 IndexedDBDispatcherHost* dispatcher_host, |
| 44 const url::Origin& origin, | 44 const url::Origin& origin, |
| 45 ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks_info); | 45 ::indexed_db::mojom::CallbacksAssociatedPtrInfo callbacks_info); |
| 46 | 46 |
| 47 virtual void OnError(const IndexedDBDatabaseError& error); | 47 virtual void OnError(const IndexedDBDatabaseError& error); |
| 48 | 48 |
| 49 // IndexedDBFactory::GetDatabaseNames | 49 // IndexedDBFactory::GetDatabaseNames |
| 50 virtual void OnSuccess(const std::vector<base::string16>& string); | 50 virtual void OnSuccess(const std::vector<base::string16>& string); |
| 51 | 51 |
| 52 // IndexedDBFactory::Open / DeleteDatabase | 52 // IndexedDBFactory::Open / DeleteDatabase |
| 53 virtual void OnBlocked(int64_t existing_version); | 53 virtual void OnBlocked(int64_t existing_version); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 | 100 |
| 101 protected: | 101 protected: |
| 102 virtual ~IndexedDBCallbacks(); | 102 virtual ~IndexedDBCallbacks(); |
| 103 | 103 |
| 104 private: | 104 private: |
| 105 friend class base::RefCounted<IndexedDBCallbacks>; | 105 friend class base::RefCounted<IndexedDBCallbacks>; |
| 106 | 106 |
| 107 class IOThreadHelper; | 107 class IOThreadHelper; |
| 108 | 108 |
| 109 // Originally from IndexedDBCallbacks: | 109 // Originally from IndexedDBCallbacks: |
| 110 scoped_refptr<IndexedDBDispatcherHost> dispatcher_host_; | 110 IndexedDBDispatcherHost* dispatcher_host_; |
|
Reilly Grant (use Gerrit)
2017/03/10 00:11:22
I'm less confident that this is safe unless we can
dmurph
2017/03/10 23:40:26
Removed. All raw pointers are removed except for o
| |
| 111 | 111 |
| 112 // IndexedDBDatabase callbacks ------------------------ | 112 // IndexedDBDatabase callbacks ------------------------ |
| 113 url::Origin origin_; | 113 url::Origin origin_; |
| 114 bool database_sent_ = false; | 114 bool database_sent_ = false; |
| 115 | 115 |
| 116 // Used to assert that OnSuccess is only called if there was no data loss. | 116 // Used to assert that OnSuccess is only called if there was no data loss. |
| 117 blink::WebIDBDataLoss data_loss_; | 117 blink::WebIDBDataLoss data_loss_; |
| 118 | 118 |
| 119 // The "blocked" event should be sent at most once per request. | 119 // The "blocked" event should be sent at most once per request. |
| 120 bool sent_blocked_; | 120 bool sent_blocked_; |
| 121 base::TimeTicks connection_open_start_time_; | 121 base::TimeTicks connection_open_start_time_; |
| 122 | 122 |
| 123 std::unique_ptr<IOThreadHelper, BrowserThread::DeleteOnIOThread> io_helper_; | 123 std::unique_ptr<IOThreadHelper, BrowserThread::DeleteOnIOThread> io_helper_; |
| 124 base::ThreadChecker thread_checker_; | 124 base::ThreadChecker thread_checker_; |
| 125 | 125 |
| 126 DISALLOW_COPY_AND_ASSIGN(IndexedDBCallbacks); | 126 DISALLOW_COPY_AND_ASSIGN(IndexedDBCallbacks); |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 } // namespace content | 129 } // namespace content |
| 130 | 130 |
| 131 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ | 131 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_CALLBACKS_H_ |
| OLD | NEW |