Index: chrome/browser/devtools/devtools_ui_bindings.cc |
diff --git a/chrome/browser/devtools/devtools_ui_bindings.cc b/chrome/browser/devtools/devtools_ui_bindings.cc |
index d7d6fa1374bd5ac6b025d4e7a8ade5f431058d12..3c06f94976c1c2654a9a43f6278b34d4a4fb8b3d 100644 |
--- a/chrome/browser/devtools/devtools_ui_bindings.cc |
+++ b/chrome/browser/devtools/devtools_ui_bindings.cc |
@@ -70,6 +70,8 @@ static const int kDevToolsActionTakenBoundary = 100; |
static const char kDevToolsPanelShownHistogram[] = "DevTools.PanelShown"; |
static const int kDevToolsPanelShownBoundary = 20; |
+// This constant should be in sync with |
+// the constant at shell_devtools_frontend.cc. |
const size_t kMaxMessageChunkSize = IPC::Channel::kMaximumMessageSize / 4; |
typedef std::vector<DevToolsUIBindings*> DevToolsUIBindingsList; |
@@ -449,9 +451,9 @@ void DevToolsUIBindings::DispatchProtocolMessage( |
DCHECK(agent_host == agent_host_.get()); |
if (message.length() < kMaxMessageChunkSize) { |
- base::StringValue message_value(message); |
- CallClientFunction("DevToolsAPI.dispatchMessage", |
- &message_value, NULL, NULL); |
+ base::string16 javascript = base::UTF8ToUTF16( |
+ "DevToolsAPI.dispatchMessage(" + message + ");"); |
+ web_contents_->GetMainFrame()->ExecuteJavaScript(javascript); |
return; |
} |