Index: Source/core/platform/chromium/support/WebSocketStreamError.cpp |
diff --git a/Source/core/platform/chromium/support/WebThreadSafeData.cpp b/Source/core/platform/chromium/support/WebSocketStreamError.cpp |
similarity index 70% |
copy from Source/core/platform/chromium/support/WebThreadSafeData.cpp |
copy to Source/core/platform/chromium/support/WebSocketStreamError.cpp |
index 8e11209b466ba907820c020efbcdcd19bbe72f13..6c534080d90333d9cd534fc64f8aa0dfa9612a45 100644 |
--- a/Source/core/platform/chromium/support/WebThreadSafeData.cpp |
+++ b/Source/core/platform/chromium/support/WebSocketStreamError.cpp |
@@ -1,10 +1,10 @@ |
/* |
- * Copyright (C) 2010 Google Inc. All rights reserved. |
- * |
+ * Copyright (C) 2013 Intel 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 |
@@ -29,47 +29,44 @@ |
*/ |
#include "config.h" |
-#include <public/WebThreadSafeData.h> |
+#include <public/WebSocketStreamError.h> |
-#include "BlobData.h" |
+#include "SocketStreamError.h" |
+#include <public/WebString.h> |
using namespace WebCore; |
namespace WebKit { |
-void WebThreadSafeData::reset() |
+void WebSocketStreamError::assign(int code, const WebString& message) |
{ |
- m_private.reset(); |
+ m_private = SocketStreamError::create(code, message); |
} |
-void WebThreadSafeData::assign(const WebThreadSafeData& other) |
+void WebSocketStreamError::assign(const WebSocketStreamError& other) |
{ |
m_private = other.m_private; |
} |
-size_t WebThreadSafeData::size() const |
+void WebSocketStreamError::reset() |
{ |
- if (m_private.isNull()) |
- return 0; |
- return m_private->length(); |
+ m_private.reset(); |
} |
-const char* WebThreadSafeData::data() const |
+WebSocketStreamError::WebSocketStreamError(PassRefPtr<SocketStreamError> error) |
{ |
- if (m_private.isNull()) |
- return 0; |
- return m_private->data(); |
+ m_private = error; |
} |
-WebThreadSafeData::WebThreadSafeData(const PassRefPtr<RawData>& data) |
- : m_private(data.leakRef()) |
+WebSocketStreamError& WebSocketStreamError::operator=(PassRefPtr<SocketStreamError> error) |
{ |
+ m_private = error; |
+ return *this; |
} |
-WebThreadSafeData& WebThreadSafeData::operator=(const PassRefPtr<RawData>& data) |
+WebSocketStreamError::operator PassRefPtr<SocketStreamError>() const |
{ |
- m_private = data; |
- return *this; |
+ return m_private.get(); |
} |
-} // namespace WebKit |
+} |