OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 } | 709 } |
710 } | 710 } |
711 | 711 |
712 // These are used to generate histograms of errors seen with websql. | 712 // These are used to generate histograms of errors seen with websql. |
713 // See about:histograms in chromium. | 713 // See about:histograms in chromium. |
714 void Database::reportOpenDatabaseResult(int errorSite, int webSqlErrorCode, int
sqliteErrorCode) | 714 void Database::reportOpenDatabaseResult(int errorSite, int webSqlErrorCode, int
sqliteErrorCode) |
715 { | 715 { |
716 if (Platform::current()->databaseObserver()) { | 716 if (Platform::current()->databaseObserver()) { |
717 Platform::current()->databaseObserver()->reportOpenDatabaseResult( | 717 Platform::current()->databaseObserver()->reportOpenDatabaseResult( |
718 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), | 718 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), |
719 stringIdentifier(), false, | 719 stringIdentifier(), errorSite, webSqlErrorCode, sqliteErrorCode); |
720 errorSite, webSqlErrorCode, sqliteErrorCode); | |
721 } | 720 } |
722 } | 721 } |
723 | 722 |
724 void Database::reportChangeVersionResult(int errorSite, int webSqlErrorCode, int
sqliteErrorCode) | 723 void Database::reportChangeVersionResult(int errorSite, int webSqlErrorCode, int
sqliteErrorCode) |
725 { | 724 { |
726 if (Platform::current()->databaseObserver()) { | 725 if (Platform::current()->databaseObserver()) { |
727 Platform::current()->databaseObserver()->reportChangeVersionResult( | 726 Platform::current()->databaseObserver()->reportChangeVersionResult( |
728 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), | 727 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), |
729 stringIdentifier(), false, | 728 stringIdentifier(), errorSite, webSqlErrorCode, sqliteErrorCode); |
730 errorSite, webSqlErrorCode, sqliteErrorCode); | |
731 } | 729 } |
732 } | 730 } |
733 | 731 |
734 void Database::reportStartTransactionResult(int errorSite, int webSqlErrorCode,
int sqliteErrorCode) | 732 void Database::reportStartTransactionResult(int errorSite, int webSqlErrorCode,
int sqliteErrorCode) |
735 { | 733 { |
736 if (Platform::current()->databaseObserver()) { | 734 if (Platform::current()->databaseObserver()) { |
737 Platform::current()->databaseObserver()->reportStartTransactionResult( | 735 Platform::current()->databaseObserver()->reportStartTransactionResult( |
738 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), | 736 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), |
739 stringIdentifier(), false, | 737 stringIdentifier(), errorSite, webSqlErrorCode, sqliteErrorCode); |
740 errorSite, webSqlErrorCode, sqliteErrorCode); | |
741 } | 738 } |
742 } | 739 } |
743 | 740 |
744 void Database::reportCommitTransactionResult(int errorSite, int webSqlErrorCode,
int sqliteErrorCode) | 741 void Database::reportCommitTransactionResult(int errorSite, int webSqlErrorCode,
int sqliteErrorCode) |
745 { | 742 { |
746 if (Platform::current()->databaseObserver()) { | 743 if (Platform::current()->databaseObserver()) { |
747 Platform::current()->databaseObserver()->reportCommitTransactionResult( | 744 Platform::current()->databaseObserver()->reportCommitTransactionResult( |
748 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), | 745 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), |
749 stringIdentifier(), false, | 746 stringIdentifier(), errorSite, webSqlErrorCode, sqliteErrorCode); |
750 errorSite, webSqlErrorCode, sqliteErrorCode); | |
751 } | 747 } |
752 } | 748 } |
753 | 749 |
754 void Database::reportExecuteStatementResult(int errorSite, int webSqlErrorCode,
int sqliteErrorCode) | 750 void Database::reportExecuteStatementResult(int errorSite, int webSqlErrorCode,
int sqliteErrorCode) |
755 { | 751 { |
756 if (Platform::current()->databaseObserver()) { | 752 if (Platform::current()->databaseObserver()) { |
757 Platform::current()->databaseObserver()->reportExecuteStatementResult( | 753 Platform::current()->databaseObserver()->reportExecuteStatementResult( |
758 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), | 754 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), |
759 stringIdentifier(), false, | 755 stringIdentifier(), errorSite, webSqlErrorCode, sqliteErrorCode); |
760 errorSite, webSqlErrorCode, sqliteErrorCode); | |
761 } | 756 } |
762 } | 757 } |
763 | 758 |
764 void Database::reportVacuumDatabaseResult(int sqliteErrorCode) | 759 void Database::reportVacuumDatabaseResult(int sqliteErrorCode) |
765 { | 760 { |
766 if (Platform::current()->databaseObserver()) { | 761 if (Platform::current()->databaseObserver()) { |
767 Platform::current()->databaseObserver()->reportVacuumDatabaseResult( | 762 Platform::current()->databaseObserver()->reportVacuumDatabaseResult( |
768 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), | 763 createDatabaseIdentifierFromSecurityOrigin(securityOrigin()), |
769 stringIdentifier(), false, sqliteErrorCode); | 764 stringIdentifier(), sqliteErrorCode); |
770 } | 765 } |
771 } | 766 } |
772 | 767 |
773 void Database::logErrorMessage(const String& message) | 768 void Database::logErrorMessage(const String& message) |
774 { | 769 { |
775 executionContext()->addConsoleMessage(ConsoleMessage::create(StorageMessageS
ource, ErrorMessageLevel, message)); | 770 executionContext()->addConsoleMessage(ConsoleMessage::create(StorageMessageS
ource, ErrorMessageLevel, message)); |
776 } | 771 } |
777 | 772 |
778 ExecutionContext* Database::executionContext() const | 773 ExecutionContext* Database::executionContext() const |
779 { | 774 { |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 SecurityOrigin* Database::securityOrigin() const | 919 SecurityOrigin* Database::securityOrigin() const |
925 { | 920 { |
926 if (executionContext()->isContextThread()) | 921 if (executionContext()->isContextThread()) |
927 return m_contextThreadSecurityOrigin.get(); | 922 return m_contextThreadSecurityOrigin.get(); |
928 if (databaseContext()->databaseThread()->isDatabaseThread()) | 923 if (databaseContext()->databaseThread()->isDatabaseThread()) |
929 return m_databaseThreadSecurityOrigin.get(); | 924 return m_databaseThreadSecurityOrigin.get(); |
930 return 0; | 925 return 0; |
931 } | 926 } |
932 | 927 |
933 } // namespace blink | 928 } // namespace blink |
OLD | NEW |