OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "webkit/glue/devtools_message_data.h" | 5 #include "webkit/glue/devtools_message_data.h" |
6 | 6 |
7 #include "third_party/WebKit/WebKit/chromium/public/WebCString.h" | 7 #include "third_party/WebKit/WebKit/chromium/public/WebCString.h" |
8 #include "third_party/WebKit/WebKit/chromium/public/WebDevToolsMessageData.h" | 8 #include "third_party/WebKit/WebKit/chromium/public/WebString.h" |
9 | 9 |
10 using WebKit::WebDevToolsMessageData; | |
11 using WebKit::WebString; | 10 using WebKit::WebString; |
12 using WebKit::WebVector; | |
13 | 11 |
14 DevToolsMessageData::DevToolsMessageData(const WebDevToolsMessageData& data) | 12 DevToolsMessageData::DevToolsMessageData(const WebDevToolsMessageData& data) |
15 : class_name(data.className.utf8()), | 13 : class_name(data.className.utf8()), |
16 method_name(data.methodName.utf8()) { | 14 method_name(data.methodName.utf8()) { |
17 for (size_t i = 0; i < data.arguments.size(); i++) | 15 for (size_t i = 0; i < data.arguments.size(); i++) |
18 arguments.push_back(data.arguments[i].utf8()); | 16 arguments.push_back(data.arguments[i].utf8()); |
19 } | 17 } |
20 | 18 |
21 WebDevToolsMessageData DevToolsMessageData::ToWebDevToolsMessageData() const { | 19 WebDevToolsMessageData DevToolsMessageData::ToWebDevToolsMessageData() const { |
22 WebDevToolsMessageData result; | 20 WebDevToolsMessageData result; |
23 result.className = WebString::fromUTF8(class_name); | 21 result.className = WebString::fromUTF8(class_name); |
24 result.methodName = WebString::fromUTF8(method_name); | 22 result.methodName = WebString::fromUTF8(method_name); |
25 WebVector<WebString> web_args(arguments.size()); | 23 WebVector<WebString> web_args(arguments.size()); |
26 for (size_t i = 0; i < arguments.size(); i++) | 24 for (size_t i = 0; i < arguments.size(); i++) |
27 web_args[i] = WebString::fromUTF8(arguments[i]); | 25 web_args[i] = WebString::fromUTF8(arguments[i]); |
28 result.arguments.swap(web_args); | 26 result.arguments.swap(web_args); |
29 return result; | 27 return result; |
30 } | 28 } |
OLD | NEW |