diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-05-26 15:44:57 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-27 11:13:02 +0200 |
commit | 790915da5400d8569e514baba3df9db087acfdf3 (patch) | |
tree | 3f8be82b795003a400b88ba49f73bc7ccdb07a50 | |
parent | d582c03233b5c2600ceb05048e7b5b6c0fb16b82 (diff) | |
download | serenity-790915da5400d8569e514baba3df9db087acfdf3.zip |
LibWeb: Provide some properties to inspectors of ResourceLoader
-rw-r--r-- | Libraries/LibWeb/ResourceLoader.cpp | 8 | ||||
-rw-r--r-- | Libraries/LibWeb/ResourceLoader.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Libraries/LibWeb/ResourceLoader.cpp b/Libraries/LibWeb/ResourceLoader.cpp index 9ef4413da2..2d1db188b9 100644 --- a/Libraries/LibWeb/ResourceLoader.cpp +++ b/Libraries/LibWeb/ResourceLoader.cpp @@ -25,6 +25,7 @@ */ #include <AK/Base64.h> +#include <AK/JsonObject.h> #include <AK/SharedBuffer.h> #include <LibCore/EventLoop.h> #include <LibCore/File.h> @@ -157,4 +158,11 @@ bool ResourceLoader::is_port_blocked(int port) return false; } +void ResourceLoader::save_to(JsonObject& object) +{ + Object::save_to(object); + object.set("pending_loads", m_pending_loads); + object.set("user_agent", m_user_agent); +} + } diff --git a/Libraries/LibWeb/ResourceLoader.h b/Libraries/LibWeb/ResourceLoader.h index b87ce20803..e9a9c0d772 100644 --- a/Libraries/LibWeb/ResourceLoader.h +++ b/Libraries/LibWeb/ResourceLoader.h @@ -56,6 +56,8 @@ private: ResourceLoader(); static bool is_port_blocked(int port); + virtual void save_to(JsonObject&) override; + int m_pending_loads { 0 }; RefPtr<Protocol::Client> m_protocol_client; |