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

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

Issue 686153003: Replace IDBPendingTransactionMonitor with end-of-recursion-scope tasks (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review feedback Created 6 years, 1 month 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) 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 { 56 {
57 m_scope.scriptState()->setExecutionContext(0); 57 m_scope.scriptState()->setExecutionContext(0);
58 } 58 }
59 59
60 v8::Isolate* isolate() const { return m_scope.isolate(); } 60 v8::Isolate* isolate() const { return m_scope.isolate(); }
61 ScriptState* scriptState() const { return m_scope.scriptState(); } 61 ScriptState* scriptState() const { return m_scope.scriptState(); }
62 ExecutionContext* executionContext() { return m_scope.scriptState()->executi onContext(); } 62 ExecutionContext* executionContext() { return m_scope.scriptState()->executi onContext(); }
63 63
64 void deactivateNewTransactions() 64 void deactivateNewTransactions()
65 { 65 {
66 V8PerIsolateData::from(isolate())->ensureIDBPendingTransactionMonitor()- >deactivateNewTransactions(); 66 V8PerIsolateData::from(isolate())->runEndOfScopeTasks();
67 } 67 }
68 68
69 private: 69 private:
70 V8TestingScope m_scope; 70 V8TestingScope m_scope;
71 RefPtrWillBePersistent<ExecutionContext> m_executionContext; 71 RefPtrWillBePersistent<ExecutionContext> m_executionContext;
72 }; 72 };
73 73
74 class FakeWebIDBDatabase final : public WebIDBDatabase { 74 class FakeWebIDBDatabase final : public WebIDBDatabase {
75 public: 75 public:
76 static PassOwnPtr<FakeWebIDBDatabase> create() { return adoptPtr(new FakeWeb IDBDatabase()); } 76 static PassOwnPtr<FakeWebIDBDatabase> create() { return adoptPtr(new FakeWeb IDBDatabase()); }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 // will not fail if it is, but ASAN would notice the error. 155 // will not fail if it is, but ASAN would notice the error.
156 db->onAbort(transactionId, DOMError::create(AbortError, "Aborted")); 156 db->onAbort(transactionId, DOMError::create(AbortError, "Aborted"));
157 157
158 // onAbort() should have cleared the transaction's reference to the database . 158 // onAbort() should have cleared the transaction's reference to the database .
159 Heap::collectAllGarbage(); 159 Heap::collectAllGarbage();
160 EXPECT_EQ(0u, set.size()); 160 EXPECT_EQ(0u, set.size());
161 } 161 }
162 162
163 } // namespace 163 } // namespace
164 } // namespace blink 164 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698