OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 return Response::Error("No IndexedDB factory for given frame found"); | 710 return Response::Error("No IndexedDB factory for given frame found"); |
711 result = idbFactory; | 711 result = idbFactory; |
712 return Response::OK(); | 712 return Response::OK(); |
713 } | 713 } |
714 | 714 |
715 void InspectorIndexedDBAgent::requestDatabaseNames( | 715 void InspectorIndexedDBAgent::requestDatabaseNames( |
716 const String& securityOrigin, | 716 const String& securityOrigin, |
717 std::unique_ptr<RequestDatabaseNamesCallback> requestCallback) { | 717 std::unique_ptr<RequestDatabaseNamesCallback> requestCallback) { |
718 LocalFrame* frame = | 718 LocalFrame* frame = |
719 m_inspectedFrames->frameWithSecurityOrigin(securityOrigin); | 719 m_inspectedFrames->frameWithSecurityOrigin(securityOrigin); |
720 ErrorString errorString; | |
721 Document* document = frame ? frame->document() : nullptr; | 720 Document* document = frame ? frame->document() : nullptr; |
722 if (!document) { | 721 if (!document) { |
723 requestCallback->sendFailure(Response::Error(kNoDocumentError)); | 722 requestCallback->sendFailure(Response::Error(kNoDocumentError)); |
724 return; | 723 return; |
725 } | 724 } |
726 IDBFactory* idbFactory = nullptr; | 725 IDBFactory* idbFactory = nullptr; |
727 Response response = assertIDBFactory(document, idbFactory); | 726 Response response = assertIDBFactory(document, idbFactory); |
728 if (!response.isSuccess()) { | 727 if (!response.isSuccess()) { |
729 requestCallback->sendFailure(response); | 728 requestCallback->sendFailure(response); |
730 return; | 729 return; |
(...skipping 20 matching lines...) Expand all Loading... |
751 document->getSecurityOrigin()->toRawString()), | 750 document->getSecurityOrigin()->toRawString()), |
752 false); | 751 false); |
753 } | 752 } |
754 | 753 |
755 void InspectorIndexedDBAgent::requestDatabase( | 754 void InspectorIndexedDBAgent::requestDatabase( |
756 const String& securityOrigin, | 755 const String& securityOrigin, |
757 const String& databaseName, | 756 const String& databaseName, |
758 std::unique_ptr<RequestDatabaseCallback> requestCallback) { | 757 std::unique_ptr<RequestDatabaseCallback> requestCallback) { |
759 LocalFrame* frame = | 758 LocalFrame* frame = |
760 m_inspectedFrames->frameWithSecurityOrigin(securityOrigin); | 759 m_inspectedFrames->frameWithSecurityOrigin(securityOrigin); |
761 ErrorString errorString; | |
762 Document* document = frame ? frame->document() : nullptr; | 760 Document* document = frame ? frame->document() : nullptr; |
763 if (!document) { | 761 if (!document) { |
764 requestCallback->sendFailure(Response::Error(kNoDocumentError)); | 762 requestCallback->sendFailure(Response::Error(kNoDocumentError)); |
765 return; | 763 return; |
766 } | 764 } |
767 IDBFactory* idbFactory = nullptr; | 765 IDBFactory* idbFactory = nullptr; |
768 Response response = assertIDBFactory(document, idbFactory); | 766 Response response = assertIDBFactory(document, idbFactory); |
769 if (!response.isSuccess()) { | 767 if (!response.isSuccess()) { |
770 requestCallback->sendFailure(response); | 768 requestCallback->sendFailure(response); |
771 return; | 769 return; |
(...skipping 16 matching lines...) Expand all Loading... |
788 const String& securityOrigin, | 786 const String& securityOrigin, |
789 const String& databaseName, | 787 const String& databaseName, |
790 const String& objectStoreName, | 788 const String& objectStoreName, |
791 const String& indexName, | 789 const String& indexName, |
792 int skipCount, | 790 int skipCount, |
793 int pageSize, | 791 int pageSize, |
794 Maybe<protocol::IndexedDB::KeyRange> keyRange, | 792 Maybe<protocol::IndexedDB::KeyRange> keyRange, |
795 std::unique_ptr<RequestDataCallback> requestCallback) { | 793 std::unique_ptr<RequestDataCallback> requestCallback) { |
796 LocalFrame* frame = | 794 LocalFrame* frame = |
797 m_inspectedFrames->frameWithSecurityOrigin(securityOrigin); | 795 m_inspectedFrames->frameWithSecurityOrigin(securityOrigin); |
798 ErrorString errorString; | |
799 Document* document = frame ? frame->document() : nullptr; | 796 Document* document = frame ? frame->document() : nullptr; |
800 if (!document) { | 797 if (!document) { |
801 requestCallback->sendFailure(Response::Error(kNoDocumentError)); | 798 requestCallback->sendFailure(Response::Error(kNoDocumentError)); |
802 return; | 799 return; |
803 } | 800 } |
804 IDBFactory* idbFactory = nullptr; | 801 IDBFactory* idbFactory = nullptr; |
805 Response response = assertIDBFactory(document, idbFactory); | 802 Response response = assertIDBFactory(document, idbFactory); |
806 if (!response.isSuccess()) { | 803 if (!response.isSuccess()) { |
807 requestCallback->sendFailure(response); | 804 requestCallback->sendFailure(response); |
808 return; | 805 return; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
923 std::unique_ptr<ClearObjectStoreCallback> m_requestCallback; | 920 std::unique_ptr<ClearObjectStoreCallback> m_requestCallback; |
924 }; | 921 }; |
925 | 922 |
926 void InspectorIndexedDBAgent::clearObjectStore( | 923 void InspectorIndexedDBAgent::clearObjectStore( |
927 const String& securityOrigin, | 924 const String& securityOrigin, |
928 const String& databaseName, | 925 const String& databaseName, |
929 const String& objectStoreName, | 926 const String& objectStoreName, |
930 std::unique_ptr<ClearObjectStoreCallback> requestCallback) { | 927 std::unique_ptr<ClearObjectStoreCallback> requestCallback) { |
931 LocalFrame* frame = | 928 LocalFrame* frame = |
932 m_inspectedFrames->frameWithSecurityOrigin(securityOrigin); | 929 m_inspectedFrames->frameWithSecurityOrigin(securityOrigin); |
933 ErrorString errorString; | |
934 Document* document = frame ? frame->document() : nullptr; | 930 Document* document = frame ? frame->document() : nullptr; |
935 if (!document) { | 931 if (!document) { |
936 requestCallback->sendFailure(Response::Error(kNoDocumentError)); | 932 requestCallback->sendFailure(Response::Error(kNoDocumentError)); |
937 return; | 933 return; |
938 } | 934 } |
939 IDBFactory* idbFactory = nullptr; | 935 IDBFactory* idbFactory = nullptr; |
940 Response response = assertIDBFactory(document, idbFactory); | 936 Response response = assertIDBFactory(document, idbFactory); |
941 if (!response.isSuccess()) { | 937 if (!response.isSuccess()) { |
942 requestCallback->sendFailure(response); | 938 requestCallback->sendFailure(response); |
943 return; | 939 return; |
(...skipping 11 matching lines...) Expand all Loading... |
955 clearObjectStore->start(idbFactory, document->getSecurityOrigin(), | 951 clearObjectStore->start(idbFactory, document->getSecurityOrigin(), |
956 databaseName); | 952 databaseName); |
957 } | 953 } |
958 | 954 |
959 DEFINE_TRACE(InspectorIndexedDBAgent) { | 955 DEFINE_TRACE(InspectorIndexedDBAgent) { |
960 visitor->trace(m_inspectedFrames); | 956 visitor->trace(m_inspectedFrames); |
961 InspectorBaseAgent::trace(visitor); | 957 InspectorBaseAgent::trace(visitor); |
962 } | 958 } |
963 | 959 |
964 } // namespace blink | 960 } // namespace blink |
OLD | NEW |