| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 bool DatabaseBackendBase::isInterrupted() | 599 bool DatabaseBackendBase::isInterrupted() |
| 600 { | 600 { |
| 601 MutexLocker locker(m_sqliteDatabase.databaseMutex()); | 601 MutexLocker locker(m_sqliteDatabase.databaseMutex()); |
| 602 return m_sqliteDatabase.isInterrupted(); | 602 return m_sqliteDatabase.isInterrupted(); |
| 603 } | 603 } |
| 604 | 604 |
| 605 // These are used to generate histograms of errors seen with websql. | 605 // These are used to generate histograms of errors seen with websql. |
| 606 // See about:histograms in chromium. | 606 // See about:histograms in chromium. |
| 607 void DatabaseBackendBase::reportOpenDatabaseResult(int errorSite, int webSqlErro
rCode, int sqliteErrorCode) | 607 void DatabaseBackendBase::reportOpenDatabaseResult(int errorSite, int webSqlErro
rCode, int sqliteErrorCode) |
| 608 { | 608 { |
| 609 if (blink::Platform::current()->databaseObserver()) { | 609 if (Platform::current()->databaseObserver()) { |
| 610 blink::Platform::current()->databaseObserver()->reportOpenDatabaseResult
( | 610 Platform::current()->databaseObserver()->reportOpenDatabaseResult( |
| 611 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), | 611 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), |
| 612 stringIdentifier(), isSyncDatabase(), | 612 stringIdentifier(), isSyncDatabase(), |
| 613 errorSite, webSqlErrorCode, sqliteErrorCode); | 613 errorSite, webSqlErrorCode, sqliteErrorCode); |
| 614 } | 614 } |
| 615 } | 615 } |
| 616 | 616 |
| 617 void DatabaseBackendBase::reportChangeVersionResult(int errorSite, int webSqlErr
orCode, int sqliteErrorCode) | 617 void DatabaseBackendBase::reportChangeVersionResult(int errorSite, int webSqlErr
orCode, int sqliteErrorCode) |
| 618 { | 618 { |
| 619 if (blink::Platform::current()->databaseObserver()) { | 619 if (Platform::current()->databaseObserver()) { |
| 620 blink::Platform::current()->databaseObserver()->reportChangeVersionResul
t( | 620 Platform::current()->databaseObserver()->reportChangeVersionResult( |
| 621 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), | 621 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), |
| 622 stringIdentifier(), isSyncDatabase(), | 622 stringIdentifier(), isSyncDatabase(), |
| 623 errorSite, webSqlErrorCode, sqliteErrorCode); | 623 errorSite, webSqlErrorCode, sqliteErrorCode); |
| 624 } | 624 } |
| 625 } | 625 } |
| 626 | 626 |
| 627 void DatabaseBackendBase::reportStartTransactionResult(int errorSite, int webSql
ErrorCode, int sqliteErrorCode) | 627 void DatabaseBackendBase::reportStartTransactionResult(int errorSite, int webSql
ErrorCode, int sqliteErrorCode) |
| 628 { | 628 { |
| 629 if (blink::Platform::current()->databaseObserver()) { | 629 if (Platform::current()->databaseObserver()) { |
| 630 blink::Platform::current()->databaseObserver()->reportStartTransactionRe
sult( | 630 Platform::current()->databaseObserver()->reportStartTransactionResult( |
| 631 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), | 631 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), |
| 632 stringIdentifier(), isSyncDatabase(), | 632 stringIdentifier(), isSyncDatabase(), |
| 633 errorSite, webSqlErrorCode, sqliteErrorCode); | 633 errorSite, webSqlErrorCode, sqliteErrorCode); |
| 634 } | 634 } |
| 635 } | 635 } |
| 636 | 636 |
| 637 void DatabaseBackendBase::reportCommitTransactionResult(int errorSite, int webSq
lErrorCode, int sqliteErrorCode) | 637 void DatabaseBackendBase::reportCommitTransactionResult(int errorSite, int webSq
lErrorCode, int sqliteErrorCode) |
| 638 { | 638 { |
| 639 if (blink::Platform::current()->databaseObserver()) { | 639 if (Platform::current()->databaseObserver()) { |
| 640 blink::Platform::current()->databaseObserver()->reportCommitTransactionR
esult( | 640 Platform::current()->databaseObserver()->reportCommitTransactionResult( |
| 641 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), | 641 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), |
| 642 stringIdentifier(), isSyncDatabase(), | 642 stringIdentifier(), isSyncDatabase(), |
| 643 errorSite, webSqlErrorCode, sqliteErrorCode); | 643 errorSite, webSqlErrorCode, sqliteErrorCode); |
| 644 } | 644 } |
| 645 } | 645 } |
| 646 | 646 |
| 647 void DatabaseBackendBase::reportExecuteStatementResult(int errorSite, int webSql
ErrorCode, int sqliteErrorCode) | 647 void DatabaseBackendBase::reportExecuteStatementResult(int errorSite, int webSql
ErrorCode, int sqliteErrorCode) |
| 648 { | 648 { |
| 649 if (blink::Platform::current()->databaseObserver()) { | 649 if (Platform::current()->databaseObserver()) { |
| 650 blink::Platform::current()->databaseObserver()->reportExecuteStatementRe
sult( | 650 Platform::current()->databaseObserver()->reportExecuteStatementResult( |
| 651 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), | 651 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), |
| 652 stringIdentifier(), isSyncDatabase(), | 652 stringIdentifier(), isSyncDatabase(), |
| 653 errorSite, webSqlErrorCode, sqliteErrorCode); | 653 errorSite, webSqlErrorCode, sqliteErrorCode); |
| 654 } | 654 } |
| 655 } | 655 } |
| 656 | 656 |
| 657 void DatabaseBackendBase::reportVacuumDatabaseResult(int sqliteErrorCode) | 657 void DatabaseBackendBase::reportVacuumDatabaseResult(int sqliteErrorCode) |
| 658 { | 658 { |
| 659 if (blink::Platform::current()->databaseObserver()) { | 659 if (Platform::current()->databaseObserver()) { |
| 660 blink::Platform::current()->databaseObserver()->reportVacuumDatabaseResu
lt( | 660 Platform::current()->databaseObserver()->reportVacuumDatabaseResult( |
| 661 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), | 661 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), |
| 662 stringIdentifier(), isSyncDatabase(), sqliteErrorCode); | 662 stringIdentifier(), isSyncDatabase(), sqliteErrorCode); |
| 663 } | 663 } |
| 664 } | 664 } |
| 665 | 665 |
| 666 void DatabaseBackendBase::logErrorMessage(const String& message) | 666 void DatabaseBackendBase::logErrorMessage(const String& message) |
| 667 { | 667 { |
| 668 executionContext()->addConsoleMessage(ConsoleMessage::create(StorageMessageS
ource, ErrorMessageLevel, message)); | 668 executionContext()->addConsoleMessage(ConsoleMessage::create(StorageMessageS
ource, ErrorMessageLevel, message)); |
| 669 } | 669 } |
| 670 | 670 |
| 671 ExecutionContext* DatabaseBackendBase::executionContext() const | 671 ExecutionContext* DatabaseBackendBase::executionContext() const |
| 672 { | 672 { |
| 673 return databaseContext()->executionContext(); | 673 return databaseContext()->executionContext(); |
| 674 } | 674 } |
| 675 | 675 |
| 676 } // namespace blink | 676 } // namespace blink |
| OLD | NEW |