| Index: ios/web/public/origin_util.mm
|
| diff --git a/ios/web/public/origin_util.cc b/ios/web/public/origin_util.mm
|
| similarity index 51%
|
| rename from ios/web/public/origin_util.cc
|
| rename to ios/web/public/origin_util.mm
|
| index 28b39a94e18e6234f2dd6ae097eca24bd9ca0755..de1d59453d85136b1f57a3a989edfbd1c99fd39e 100644
|
| --- a/ios/web/public/origin_util.cc
|
| +++ b/ios/web/public/origin_util.mm
|
| @@ -2,10 +2,15 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "ios/web/public/origin_util.h"
|
| +#import "ios/web/public/origin_util.h"
|
|
|
| +#import <WebKit/WebKit.h>
|
| +
|
| +#include "base/numerics/safe_conversions.h"
|
| +#include "base/strings/sys_string_conversions.h"
|
| #include "net/base/url_util.h"
|
| #include "url/gurl.h"
|
| +#include "url/scheme_host_port.h"
|
|
|
| namespace web {
|
|
|
| @@ -25,4 +30,14 @@ bool IsOriginSecure(const GURL& url) {
|
| return false;
|
| }
|
|
|
| +GURL GURLOriginWithWKSecurityOrigin(WKSecurityOrigin* origin) {
|
| + if (!origin)
|
| + return GURL();
|
| +
|
| + url::SchemeHostPort origin_tuple(base::SysNSStringToUTF8(origin.protocol),
|
| + base::SysNSStringToUTF8(origin.host),
|
| + base::checked_cast<uint16_t>(origin.port));
|
| + return GURL(origin_tuple.Serialize());
|
| +}
|
| +
|
| } // namespace web
|
|
|