summaryrefslogtreecommitdiff
path: root/Source/WebCore/workers/WorkerLocation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/workers/WorkerLocation.cpp')
-rw-r--r--Source/WebCore/workers/WorkerLocation.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/Source/WebCore/workers/WorkerLocation.cpp b/Source/WebCore/workers/WorkerLocation.cpp
index 3a637c2c4..def41ffc1 100644
--- a/Source/WebCore/workers/WorkerLocation.cpp
+++ b/Source/WebCore/workers/WorkerLocation.cpp
@@ -10,10 +10,10 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
@@ -21,13 +21,12 @@
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
*/
#include "config.h"
-
#include "WorkerLocation.h"
+#include "SecurityOrigin.h"
#include <wtf/text/WTFString.h>
namespace WebCore {
@@ -39,12 +38,12 @@ String WorkerLocation::href() const
String WorkerLocation::protocol() const
{
- return m_url.protocol() + ":";
+ return makeString(m_url.protocol(), ":");
}
String WorkerLocation::host() const
{
- return m_url.port() ? m_url.host() + ":" + String::number(m_url.port()) : m_url.host();
+ return m_url.hostAndPort();
}
String WorkerLocation::hostname() const
@@ -54,7 +53,7 @@ String WorkerLocation::hostname() const
String WorkerLocation::port() const
{
- return m_url.port() ? String::number(m_url.port()) : "";
+ return m_url.port() ? String::number(m_url.port().value()) : emptyString();
}
String WorkerLocation::pathname() const
@@ -72,5 +71,9 @@ String WorkerLocation::hash() const
return m_url.fragmentIdentifier().isEmpty() ? emptyString() : "#" + m_url.fragmentIdentifier();
}
+String WorkerLocation::origin() const
+{
+ return SecurityOrigin::create(m_url)->toString();
+}
} // namespace WebCore