Remove security concerned logs
[framework/web/webkit-efl.git] / Source / WebKit2 / UIProcess / API / efl / ewk_security_origin.cpp
1 /*
2    Copyright (C) 2012 Samsung Electronics
3
4     This library is free software; you can redistribute it and/or
5     modify it under the terms of the GNU Library General Public
6     License as published by the Free Software Foundation; either
7     version 2 of the License, or (at your option) any later version.
8
9     This library is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12     Library General Public License for more details.
13
14     You should have received a copy of the GNU Library General Public License
15     along with this library; see the file COPYING.LIB.  If not, write to
16     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17     Boston, MA 02110-1301, USA.
18 */
19
20 #include "config.h"
21 #include "ewk_security_origin.h"
22
23 #if OS(TIZEN)
24 #include "WKAPICast.h"
25 #include "WebSecurityOrigin.h"
26 #include "ewk_view_private.h"
27 #include <wtf/text/CString.h>
28
29 struct _Ewk_Security_Origin {
30     const char* host;
31     const char* protocol;
32     uint16_t port;
33 };
34
35 using namespace WebKit;
36
37 Ewk_Security_Origin* createSecurityOrigin(WKSecurityOriginRef securityOrigin)
38 {
39     Ewk_Security_Origin* origin = new Ewk_Security_Origin();
40
41     origin->host = eina_stringshare_add(toImpl(securityOrigin)->host().utf8().data());
42     origin->protocol = eina_stringshare_add(toImpl(securityOrigin)->protocol().utf8().data());
43     origin->port = toImpl(securityOrigin)->port();
44
45     return origin;
46 }
47
48 void deleteSecurityOrigin(Ewk_Security_Origin* origin)
49 {
50     eina_stringshare_del(origin->host);
51     eina_stringshare_del(origin->protocol);
52     delete origin;
53 }
54
55 const char* ewk_security_origin_host_get(const Ewk_Security_Origin* origin)
56 {
57     EINA_SAFETY_ON_NULL_RETURN_VAL(origin, 0);
58
59     return origin->host;
60 }
61
62 const char* ewk_security_origin_protocol_get(const Ewk_Security_Origin* origin)
63 {
64     EINA_SAFETY_ON_NULL_RETURN_VAL(origin, 0);
65     TIZEN_LOGI("protocol (%s)", origin->protocol);
66
67     return origin->protocol;
68 }
69
70 uint16_t ewk_security_origin_port_get(const Ewk_Security_Origin* origin)
71 {
72     EINA_SAFETY_ON_NULL_RETURN_VAL(origin, 0);
73     TIZEN_LOGI("port (%d)", origin->port);
74
75     return origin->port;
76 }
77 #endif