Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1138)

Unified Diff: chrome/browser/devtools/devtools_ui_bindings.cc

Issue 784513002: DevTools: speed up DevToolsUIBindings::DispatchProtocolMessage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/shell/browser/shell_devtools_frontend.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | content/shell/browser/shell_devtools_frontend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698