summaryrefslogtreecommitdiffstats
path: root/webkit/api/src/WebString.cpp
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-08 05:35:47 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-08 05:35:47 +0000
commit70f7efe52831ef7f900c33af139c33d9c95f7dc4 (patch)
tree42faab048f58f64dec7019190ebe05e6b2627faa /webkit/api/src/WebString.cpp
parent8d3aa94c59b93c15c14e3f31376d5b5b55b9ec6a (diff)
downloadchromium_src-70f7efe52831ef7f900c33af139c33d9c95f7dc4.zip
chromium_src-70f7efe52831ef7f900c33af139c33d9c95f7dc4.tar.gz
chromium_src-70f7efe52831ef7f900c33af139c33d9c95f7dc4.tar.bz2
Add implicit AtomicString conversion to WebString. Get rid of a couple explicit casts that are no longer needed.
TEST=none BUG=none Review URL: http://codereview.chromium.org/164221 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22862 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/api/src/WebString.cpp')
-rw-r--r--webkit/api/src/WebString.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/webkit/api/src/WebString.cpp b/webkit/api/src/WebString.cpp
index 08da985..9d1b2d6 100644
--- a/webkit/api/src/WebString.cpp
+++ b/webkit/api/src/WebString.cpp
@@ -1,10 +1,10 @@
/*
* Copyright (C) 2009 Google Inc. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
@@ -14,7 +14,7 @@
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@@ -32,6 +32,7 @@
#include "WebString.h"
#include "PlatformString.h"
+#include "AtomicString.h"
namespace WebKit {
@@ -95,6 +96,23 @@ WebString::operator WebCore::String() const
return m_private;
}
+WebString::WebString(const WebCore::AtomicString& s)
+ : m_private(0)
+{
+ assign(s.string());
+}
+
+WebString& WebString::operator=(const WebCore::AtomicString& s)
+{
+ assign(s.string());
+ return *this;
+}
+
+WebString::operator WebCore::AtomicString() const
+{
+ return WebCore::AtomicString(static_cast<WebCore::StringImpl *>(m_private));
+}
+
void WebString::assign(WebStringPrivate* p)
{
// Take care to handle the case where m_private == p