OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // TODO(darin): This file will be deleted once we complete the move to | 5 // TODO(darin): This file will be deleted once we complete the move to |
6 // webkit/api | 6 // webkit/api |
7 | 7 |
8 // In this file, we pretend to be part of the WebKit implementation. | 8 // In this file, we pretend to be part of the WebKit implementation. |
9 // This is just a temporary hack while glue is still being moved into | 9 // This is just a temporary hack while glue is still being moved into |
10 // webkit/api. | 10 // webkit/api. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 return WebKit::WebString::fromUTF8(str.data(), str.size()); | 119 return WebKit::WebString::fromUTF8(str.data(), str.size()); |
120 } | 120 } |
121 | 121 |
122 std::string WebStringToStdString(const WebKit::WebString& str) { | 122 std::string WebStringToStdString(const WebKit::WebString& str) { |
123 std::string ret; | 123 std::string ret; |
124 if (!str.isNull()) | 124 if (!str.isNull()) |
125 UTF16ToUTF8(str.data(), str.length(), &ret); | 125 UTF16ToUTF8(str.data(), str.length(), &ret); |
126 return ret; | 126 return ret; |
127 } | 127 } |
128 | 128 |
| 129 WebKit::WebData SharedBufferToWebData( |
| 130 const WTF::PassRefPtr<WebCore::SharedBuffer>& buf) { |
| 131 return buf; |
| 132 } |
| 133 |
| 134 WTF::PassRefPtr<WebCore::SharedBuffer> WebDataToSharedBuffer( |
| 135 const WebKit::WebData& data) { |
| 136 return data; |
| 137 } |
| 138 |
129 FilePath::StringType StringToFilePathString(const WebCore::String& str) { | 139 FilePath::StringType StringToFilePathString(const WebCore::String& str) { |
130 #if defined(OS_WIN) | 140 #if defined(OS_WIN) |
131 return StringToStdWString(str); | 141 return StringToStdWString(str); |
132 #elif defined(OS_POSIX) | 142 #elif defined(OS_POSIX) |
133 return base::SysWideToNativeMB(StringToStdWString(str)); | 143 return base::SysWideToNativeMB(StringToStdWString(str)); |
134 #endif | 144 #endif |
135 } | 145 } |
136 | 146 |
137 WebCore::String FilePathStringToString(const FilePath::StringType& str) { | 147 WebCore::String FilePathStringToString(const FilePath::StringType& str) { |
138 #if defined(OS_WIN) | 148 #if defined(OS_WIN) |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 WebKit::WebURLResponse* response) { | 296 WebKit::WebURLResponse* response) { |
287 return &response->toMutableResourceResponse(); | 297 return &response->toMutableResourceResponse(); |
288 } | 298 } |
289 | 299 |
290 const WebCore::ResourceResponse* WebURLResponseToResourceResponse( | 300 const WebCore::ResourceResponse* WebURLResponseToResourceResponse( |
291 const WebKit::WebURLResponse* response) { | 301 const WebKit::WebURLResponse* response) { |
292 return &response->toResourceResponse(); | 302 return &response->toResourceResponse(); |
293 } | 303 } |
294 | 304 |
295 } // namespace webkit_glue | 305 } // namespace webkit_glue |
OLD | NEW |