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

Side by Side Diff: Source/modules/webdatabase/SQLTransactionBackend.cpp

Issue 211933005: Oilpan: Prepare to move SQLTransactionWrapper and CangeVersionWrapper to Oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/modules/webdatabase/SQLTransactionBackend.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2013 Apple 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 // 334 //
335 // Phase 5: After state CleanupAndTerminate 335 // Phase 5: After state CleanupAndTerminate
336 // 336 //
337 // - This is how a transaction ends normally. 337 // - This is how a transaction ends normally.
338 // - state CleanupAndTerminate calls doCleanup(). 338 // - state CleanupAndTerminate calls doCleanup().
339 339
340 340
341 namespace WebCore { 341 namespace WebCore {
342 342
343 PassRefPtrWillBeRawPtr<SQLTransactionBackend> SQLTransactionBackend::create(Data baseBackend* db, 343 PassRefPtrWillBeRawPtr<SQLTransactionBackend> SQLTransactionBackend::create(Data baseBackend* db,
344 PassRefPtrWillBeRawPtr<AbstractSQLTransaction> frontend, PassRefPtr<SQLTrans actionWrapper> wrapper, bool readOnly) 344 PassRefPtrWillBeRawPtr<AbstractSQLTransaction> frontend,
345 PassRefPtrWillBeRawPtr<SQLTransactionWrapper> wrapper,
346 bool readOnly)
345 { 347 {
346 return adoptRefWillBeNoop(new SQLTransactionBackend(db, frontend, wrapper, r eadOnly)); 348 return adoptRefWillBeNoop(new SQLTransactionBackend(db, frontend, wrapper, r eadOnly));
347 } 349 }
348 350
349 SQLTransactionBackend::SQLTransactionBackend(DatabaseBackend* db, 351 SQLTransactionBackend::SQLTransactionBackend(DatabaseBackend* db,
350 PassRefPtrWillBeRawPtr<AbstractSQLTransaction> frontend, PassRefPtr<SQLTrans actionWrapper> wrapper, bool readOnly) 352 PassRefPtrWillBeRawPtr<AbstractSQLTransaction> frontend,
353 PassRefPtrWillBeRawPtr<SQLTransactionWrapper> wrapper,
354 bool readOnly)
351 : m_frontend(frontend) 355 : m_frontend(frontend)
352 , m_database(db) 356 , m_database(db)
353 , m_wrapper(wrapper) 357 , m_wrapper(wrapper)
354 , m_hasCallback(m_frontend->hasCallback()) 358 , m_hasCallback(m_frontend->hasCallback())
355 , m_hasSuccessCallback(m_frontend->hasSuccessCallback()) 359 , m_hasSuccessCallback(m_frontend->hasSuccessCallback())
356 , m_hasErrorCallback(m_frontend->hasErrorCallback()) 360 , m_hasErrorCallback(m_frontend->hasErrorCallback())
357 , m_shouldRetryCurrentStatement(false) 361 , m_shouldRetryCurrentStatement(false)
358 , m_modifiedDatabase(false) 362 , m_modifiedDatabase(false)
359 , m_lockAcquired(false) 363 , m_lockAcquired(false)
360 , m_readOnly(readOnly) 364 , m_readOnly(readOnly)
361 , m_hasVersionMismatch(false) 365 , m_hasVersionMismatch(false)
362 { 366 {
363 ASSERT(m_database); 367 ASSERT(m_database);
364 m_frontend->setBackend(this); 368 m_frontend->setBackend(this);
365 m_requestedState = SQLTransactionState::AcquireLock; 369 m_requestedState = SQLTransactionState::AcquireLock;
366 } 370 }
367 371
368 SQLTransactionBackend::~SQLTransactionBackend() 372 SQLTransactionBackend::~SQLTransactionBackend()
369 { 373 {
370 ASSERT(!m_sqliteTransaction); 374 ASSERT(!m_sqliteTransaction);
371 } 375 }
372 376
373 void SQLTransactionBackend::trace(Visitor* visitor) 377 void SQLTransactionBackend::trace(Visitor* visitor)
374 { 378 {
375 visitor->trace(m_frontend); 379 visitor->trace(m_frontend);
376 visitor->trace(m_currentStatementBackend); 380 visitor->trace(m_currentStatementBackend);
377 visitor->trace(m_database); 381 visitor->trace(m_database);
382 visitor->trace(m_wrapper);
378 visitor->trace(m_statementQueue); 383 visitor->trace(m_statementQueue);
379 } 384 }
380 385
381 void SQLTransactionBackend::doCleanup() 386 void SQLTransactionBackend::doCleanup()
382 { 387 {
383 if (!m_frontend) 388 if (!m_frontend)
384 return; 389 return;
385 m_frontend = nullptr; // Break the reference cycle. See comment about the li fe-cycle above. 390 m_frontend = nullptr; // Break the reference cycle. See comment about the li fe-cycle above.
386 391
387 ASSERT(database()->databaseContext()->databaseThread()->isDatabaseThread()); 392 ASSERT(database()->databaseContext()->databaseThread()->isDatabaseThread());
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 } 826 }
822 827
823 SQLTransactionState SQLTransactionBackend::sendToFrontendState() 828 SQLTransactionState SQLTransactionBackend::sendToFrontendState()
824 { 829 {
825 ASSERT(m_nextState != SQLTransactionState::Idle); 830 ASSERT(m_nextState != SQLTransactionState::Idle);
826 m_frontend->requestTransitToState(m_nextState); 831 m_frontend->requestTransitToState(m_nextState);
827 return SQLTransactionState::Idle; 832 return SQLTransactionState::Idle;
828 } 833 }
829 834
830 } // namespace WebCore 835 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/modules/webdatabase/SQLTransactionBackend.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698