summaryrefslogtreecommitdiffstats
path: root/webkit/glue/devtools/devtools_message_data.cc
blob: 68280fb0a88aec5f4d72a4f6ddaea4708c9b380e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "config.h"

#undef LOG

#include "third_party/WebKit/WebKit/chromium/public/WebDevToolsMessageData.h"
#include "webkit/glue/devtools/devtools_message_data.h"
#include "webkit/glue/glue_util.h"

DevToolsMessageData::DevToolsMessageData(
    const WebKit::WebDevToolsMessageData& data)
    : class_name(webkit_glue::WebStringToStdString(data.className)),
      method_name(webkit_glue::WebStringToStdString(data.methodName)) {
  for (size_t i = 0; i < data.arguments.size(); i++)
    arguments.push_back(webkit_glue::WebStringToStdString(data.arguments[i]));
}

WebKit::WebDevToolsMessageData
    DevToolsMessageData::ToWebDevToolsMessageData() const {
  WebKit::WebDevToolsMessageData result;
  result.className = webkit_glue::StdStringToWebString(class_name);
  result.methodName = webkit_glue::StdStringToWebString(method_name);
  WebKit::WebVector<WebKit::WebString> web_args(arguments.size());
  for (size_t i = 0; i < arguments.size(); i++)
    web_args[i] = webkit_glue::StdStringToWebString(arguments[i]);
  result.arguments.swap(web_args);
  return result;
}