OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 { | 58 { |
59 return m_document.get(); | 59 return m_document.get(); |
60 } | 60 } |
61 | 61 |
62 private: | 62 private: |
63 v8::HandleScope m_handleScope; | 63 v8::HandleScope m_handleScope; |
64 v8::Context::Scope m_scope; | 64 v8::Context::Scope m_scope; |
65 RefPtr<Document> m_document; | 65 RefPtr<Document> m_document; |
66 }; | 66 }; |
67 | 67 |
68 class FakeWebIDBDatabase : public blink::WebIDBDatabase { | 68 class FakeWebIDBDatabase FINAL : public blink::WebIDBDatabase { |
69 public: | 69 public: |
70 static PassOwnPtr<FakeWebIDBDatabase> create() { return adoptPtr(new FakeWeb
IDBDatabase()); } | 70 static PassOwnPtr<FakeWebIDBDatabase> create() { return adoptPtr(new FakeWeb
IDBDatabase()); } |
71 | 71 |
72 virtual void commit(long long transactionId) OVERRIDE { } | 72 virtual void commit(long long transactionId) OVERRIDE { } |
73 virtual void abort(long long transactionId) OVERRIDE { } | 73 virtual void abort(long long transactionId) OVERRIDE { } |
74 virtual void close() OVERRIDE { } | 74 virtual void close() OVERRIDE { } |
75 | 75 |
76 private: | 76 private: |
77 FakeWebIDBDatabase() { } | 77 FakeWebIDBDatabase() { } |
78 }; | 78 }; |
79 | 79 |
80 class FakeIDBDatabaseCallbacks : public IDBDatabaseCallbacks { | 80 class FakeIDBDatabaseCallbacks FINAL : public IDBDatabaseCallbacks { |
81 public: | 81 public: |
82 static PassRefPtr<FakeIDBDatabaseCallbacks> create() { return adoptRef(new F
akeIDBDatabaseCallbacks()); } | 82 static PassRefPtr<FakeIDBDatabaseCallbacks> create() { return adoptRef(new F
akeIDBDatabaseCallbacks()); } |
83 virtual void onVersionChange(int64_t oldVersion, int64_t newVersion) OVERRID
E { } | 83 virtual void onVersionChange(int64_t oldVersion, int64_t newVersion) OVERRID
E { } |
84 virtual void onForcedClose() OVERRIDE { } | 84 virtual void onForcedClose() OVERRIDE { } |
85 virtual void onAbort(int64_t transactionId, PassRefPtr<DOMError> error) OVER
RIDE { } | 85 virtual void onAbort(int64_t transactionId, PassRefPtr<DOMError> error) OVER
RIDE { } |
86 virtual void onComplete(int64_t transactionId) OVERRIDE { } | 86 virtual void onComplete(int64_t transactionId) OVERRIDE { } |
87 private: | 87 private: |
88 FakeIDBDatabaseCallbacks() { } | 88 FakeIDBDatabaseCallbacks() { } |
89 }; | 89 }; |
90 | 90 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 // Stop the context, so events don't get queued (which would keep the transa
ction alive). | 142 // Stop the context, so events don't get queued (which would keep the transa
ction alive). |
143 executionContext()->stopActiveDOMObjects(); | 143 executionContext()->stopActiveDOMObjects(); |
144 | 144 |
145 // Fire an abort to make sure this doesn't free the transaction during use.
The test | 145 // Fire an abort to make sure this doesn't free the transaction during use.
The test |
146 // will not fail if it is, but ASAN would notice the error. | 146 // will not fail if it is, but ASAN would notice the error. |
147 db->onAbort(transactionId, DOMError::create(AbortError, "Aborted")); | 147 db->onAbort(transactionId, DOMError::create(AbortError, "Aborted")); |
148 } | 148 } |
149 | 149 |
150 } // namespace | 150 } // namespace |
OLD | NEW |