Commit 7e44d3d4 authored by Ben Reich's avatar Ben Reich Committed by Commit Bot

[filesapp] std::string parameters to std::string& in DevToolListener

Change all const std::string into const std::string& to avoid
copying strings on every function invocation.

Test: browser_tests --gtest_filter="*FilesApp*" --devtools-code-coverage
Bug: 1113941
Change-Id: Id3e5a767b575417cf122c85de961e752981ddb16
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2453343
Auto-Submit: Ben Reich <benreich@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Commit-Queue: Noel Gordon <noel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814581}
parent c6d67b48
......@@ -58,7 +58,7 @@ bool DevToolsListener::HasCoverage(content::DevToolsAgentHost* host) {
void DevToolsListener::GetCoverage(content::DevToolsAgentHost* host,
const base::FilePath& store,
const std::string test) {
const std::string& test) {
if (HasCoverage(host))
StopAndStoreJSCoverage(host, store, test);
navigated_ = false;
......@@ -72,7 +72,7 @@ void DevToolsListener::Detach(content::DevToolsAgentHost* host) {
}
std::string DevToolsListener::HostString(content::DevToolsAgentHost* host,
const std::string prefix = "") {
const std::string& prefix = "") {
std::string result = base::StrCat(
{prefix, " ", host->GetType(), " title: ", host->GetTitle()});
std::string description = host->GetDescription();
......@@ -114,7 +114,7 @@ bool DevToolsListener::StartJSCoverage(content::DevToolsAgentHost* host) {
void DevToolsListener::StopAndStoreJSCoverage(content::DevToolsAgentHost* host,
const base::FilePath& store,
const std::string test) {
const std::string& test) {
std::string precise_coverage =
"{\"id\":40,\"method\":\"Profiler.takePreciseCoverage\"}";
host->DispatchProtocolMessage(this, StringToSpan(precise_coverage));
......
......@@ -34,7 +34,7 @@ class DevToolsListener : public content::DevToolsAgentHostClient {
// write it into the |store|.
void GetCoverage(content::DevToolsAgentHost* host,
const base::FilePath& store,
const std::string test);
const std::string& test);
// Detaches from a host.
void Detach(content::DevToolsAgentHost* host);
......@@ -42,7 +42,7 @@ class DevToolsListener : public content::DevToolsAgentHostClient {
// Returns a string that uniquely identifies a host
// with an optional prefix.
static std::string HostString(content::DevToolsAgentHost* host,
const std::string prefix);
const std::string& prefix);
private:
// Enable CDP on host.
......@@ -55,7 +55,7 @@ class DevToolsListener : public content::DevToolsAgentHostClient {
// it into the |store|.
void StopAndStoreJSCoverage(content::DevToolsAgentHost* host,
const base::FilePath& store,
const std::string test);
const std::string& test);
// Stores scripts that are parsed during execution on host.
void StoreScripts(content::DevToolsAgentHost* host,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment