Add a factory method to create url::Origin objects from GURL

The current constructor is very complicated and hard to add additional
logic to. It would be simpler to pull the logic out-of-line into the
factory method and simplify the constructor.

[email protected]

Bug: 768460
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: Iee93b159088c7e39c77a13347a4ab9959cca5681
Reviewed-on: https://chromium-review.googlesource.com/729539
Commit-Queue: Daniel Cheng <[email protected]>
Reviewed-by: Mike West <[email protected]>
Reviewed-by: Mike West <[email protected]>
Cr-Commit-Position: refs/heads/master@{#510375}
diff --git a/net/websockets/websocket_end_to_end_test.cc b/net/websockets/websocket_end_to_end_test.cc
index 373b8cef..05de3ff 100644
--- a/net/websockets/websocket_end_to_end_test.cc
+++ b/net/websockets/websocket_end_to_end_test.cc
@@ -277,7 +277,7 @@
     if (!initialised_context_) {
       InitialiseContext();
     }
-    url::Origin origin(GURL("http://localhost"));
+    url::Origin origin = url::Origin::Create(GURL("http://localhost"));
     GURL site_for_cookies("http://localhost/");
     event_interface_ = new ConnectTestingEventInterface;
     channel_.reset(