1 // Copyright 2013 Samsung Electronics. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ewk_security_origin.h"
6 #include "private/ewk_security_origin_private.h"
10 * @param origin security origin
12 * @return host of security origin
14 Eina_Stringshare* ewk_security_origin_host_get(const Ewk_Security_Origin* origin)
16 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, 0);
17 return origin->GetHost();
21 * Requests for getting host of security origin.
23 * @param origin security origin
25 * @return protocol of security origin
27 Eina_Stringshare* ewk_security_origin_protocol_get(const Ewk_Security_Origin* origin)
29 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, 0);
30 return origin->GetProtocol();
34 * Requests for getting host of security origin.
36 * @param origin security origin
38 * @return port of security origin
40 uint16_t ewk_security_origin_port_get(const Ewk_Security_Origin* origin)
42 EINA_SAFETY_ON_NULL_RETURN_VAL(origin, 0);
43 return static_cast<uint16_t>(origin->GetPort());
46 void ewk_security_origin_free(Ewk_Security_Origin *o)
51 Ewk_Security_Origin *ewk_security_origin_new_from_string(const char *url)
53 return static_cast<Ewk_Security_Origin *>(_Ewk_Security_Origin::CreateFromString(url));