diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 16:00:32 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 16:00:32 +0000 |
commit | 4f4dc2f3fcb01bc6402cbaa83d0935194f992cb5 (patch) | |
tree | 03be2eea80b1048c588f5883247bcc776566f76f /chrome/renderer/devtools_agent.cc | |
parent | 07fc26a8ea76b29d6deb598664ed7b54b9ed2606 (diff) | |
download | chromium_src-4f4dc2f3fcb01bc6402cbaa83d0935194f992cb5.zip chromium_src-4f4dc2f3fcb01bc6402cbaa83d0935194f992cb5.tar.gz chromium_src-4f4dc2f3fcb01bc6402cbaa83d0935194f992cb5.tar.bz2 |
Convert devtools interfaces over to using WebString.
Also converts some internal std::string usage to WebCore::String.
Note: copying WebString to WebCore::String is very cheap (just
increments a reference count).
The ugly WebStringToString and StringToWebString calls inside the
devtools implementation are temporary. Once this code moves into
the WebKit API implementation, those methods will go away.
I thought about changing the devtools IPCs to use string16 instead
of std::string because that would avoid the UTF8 conversions. I'm
not sure if that is worth it though given that UTF16 would increase
the amount of data being sent over IPC. I figure this is something
that could be studied later.
R=pfeldman
BUG=24597
TEST=none
Review URL: http://codereview.chromium.org/264077
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29286 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/devtools_agent.cc')
-rw-r--r-- | chrome/renderer/devtools_agent.cc | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/chrome/renderer/devtools_agent.cc b/chrome/renderer/devtools_agent.cc index aa6baad3..7d0f279 100644 --- a/chrome/renderer/devtools_agent.cc +++ b/chrome/renderer/devtools_agent.cc @@ -7,8 +7,11 @@ #include "chrome/common/devtools_messages.h" #include "chrome/common/render_messages.h" #include "chrome/renderer/render_view.h" +#include "webkit/api/public/WebString.h" #include "webkit/glue/webdevtoolsagent.h" +using WebKit::WebString; + // static std::map<int, DevToolsAgent*> DevToolsAgent::agent_for_routing_id_; @@ -44,15 +47,19 @@ bool DevToolsAgent::OnMessageReceived(const IPC::Message& message) { return handled; } -void DevToolsAgent::SendMessageToClient(const std::string& class_name, - const std::string& method_name, - const std::string& param1, - const std::string& param2, - const std::string& param3) { +void DevToolsAgent::SendMessageToClient(const WebKit::WebString& class_name, + const WebKit::WebString& method_name, + const WebKit::WebString& param1, + const WebKit::WebString& param2, + const WebKit::WebString& param3) { IPC::Message* m = new ViewHostMsg_ForwardToDevToolsClient( routing_id_, - DevToolsClientMsg_RpcMessage(class_name, method_name, param1, param2, - param3)); + DevToolsClientMsg_RpcMessage( + class_name.utf8(), + method_name.utf8(), + param1.utf8(), + param2.utf8(), + param3.utf8())); view_->Send(m); } @@ -95,8 +102,12 @@ void DevToolsAgent::OnRpcMessage(const std::string& class_name, const std::string& param3) { WebDevToolsAgent* web_agent = GetWebAgent(); if (web_agent) { - web_agent->DispatchMessageFromClient(class_name, method_name, param1, - param2, param3); + web_agent->DispatchMessageFromClient( + WebString::fromUTF8(class_name), + WebString::fromUTF8(method_name), + WebString::fromUTF8(param1), + WebString::fromUTF8(param2), + WebString::fromUTF8(param3)); } } |