[EFL] Add shortcut to dump Security Origin and Web Database information
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 May 2012 14:16:29 +0000 (14:16 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 May 2012 14:16:29 +0000 (14:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=86521

Patch by Thiago Marcos P. Santos <thiago.santos@intel.com> on 2012-05-18
Reviewed by Gustavo Noronha Silva.

Added key combination (CTRL+s) to dump information about the
security origin and databases of the main frame. Useful for API
testing and debugging.

* EWebLauncher/main.c:
(on_key_down):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@117589 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/EWebLauncher/main.c

index e5f71d9..fd08e77 100644 (file)
@@ -1,3 +1,17 @@
+2012-05-18  Thiago Marcos P. Santos  <thiago.santos@intel.com>
+
+        [EFL] Add shortcut to dump Security Origin and Web Database information
+        https://bugs.webkit.org/show_bug.cgi?id=86521
+
+        Reviewed by Gustavo Noronha Silva.
+
+        Added key combination (CTRL+s) to dump information about the
+        security origin and databases of the main frame. Useful for API
+        testing and debugging.
+
+        * EWebLauncher/main.c:
+        (on_key_down):
+
 2012-05-18  Sudarsana Nagineni  <sudarsana.nagineni@linux.intel.com>
 
         [EFL] DRT needs an implementation of layoutTestController.setSerializeHTTPLoads
index 8cc2283..dfe0ef8 100644 (file)
@@ -2,6 +2,7 @@
  * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
  * Copyright (C) 2009, 2010 ProFUSION embedded systems
  * Copyright (C) 2009, 2010, 2011 Samsung Electronics
+ * Copyright (C) 2012 Intel Corporation
  *
  * All rights reserved.
  *
@@ -37,6 +38,7 @@
 #include <Ecore_X.h>
 #include <Edje.h>
 #include <Evas.h>
+#include <inttypes.h>
 #include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -99,7 +101,8 @@ static const Ecore_Getopt options = {
     "0.0.1",
     "(C)2008 INdT (The Nokia Technology Institute)\n"
     "(C)2009, 2010 ProFUSION embedded systems\n"
-    "(C)2009, 2010, 2011 Samsung Electronics",
+    "(C)2009, 2010, 2011 Samsung Electronics\n"
+    "(C)2012 Intel Corporation\n",
     "GPL",
     "Test Web Browser using the Enlightenment Foundation Libraries of WebKit",
     EINA_TRUE, {
@@ -552,6 +555,37 @@ on_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
     } else if (!strcmp(ev->key, "e") && ctrlPressed) {
         info("Render resumed");
         ewk_view_enable_render(obj);
+    } else if (!strcmp(ev->key, "s") && ctrlPressed) {
+        Evas_Object *frame = ewk_view_frame_main_get(obj);
+        Ewk_Security_Origin *origin = ewk_frame_security_origin_get(frame);
+        printf("Security origin information:\n"
+               "  protocol=%s\n"
+               "  host=%s\n"
+               "  port=%d\n"
+               "  web database quota=%" PRIu64 "\n",
+               ewk_security_origin_protocol_get(origin),
+               ewk_security_origin_host_get(origin),
+               ewk_security_origin_port_get(origin),
+               ewk_security_origin_web_database_quota_get(origin));
+
+        Eina_List *databaseList = ewk_security_origin_web_database_get_all(origin);
+        Eina_List *listIterator = 0;
+        Ewk_Web_Database *database;
+        EINA_LIST_FOREACH(databaseList, listIterator, database)
+            printf("Database information:\n"
+                   "  name=%s\n"
+                   "  display name=%s\n"
+                   "  filename=%s\n"
+                   "  expected size=%" PRIu64 "\n"
+                   "  size=%" PRIu64 "\n",
+                   ewk_web_database_name_get(database),
+                   ewk_web_database_display_name_get(database),
+                   ewk_web_database_filename_get(database),
+                   ewk_web_database_expected_size_get(database),
+                   ewk_web_database_size_get(database));
+
+        ewk_security_origin_free(origin);
+        ewk_web_database_list_free(databaseList);
     }
 }