diff options
author | ki.stfu <ki.stfu@gmail.com> | 2015-09-27 21:41:20 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-28 04:42:06 +0000 |
commit | 939799a4b72e978038109fce97bf043b988428b4 (patch) | |
tree | b5dcf22a458103cd3c7ebc35ec117665c2f2c080 /components/test_runner | |
parent | 96e79b2a53fddaac6040ca2e699c33fbdf44641c (diff) | |
download | chromium_src-939799a4b72e978038109fce97bf043b988428b4.zip chromium_src-939799a4b72e978038109fce97bf043b988428b4.tar.gz chromium_src-939799a4b72e978038109fce97bf043b988428b4.tar.bz2 |
Cleanup: Pass std::string as const reference from components/
Passing std::string by reference can prevent extra copying of object.
BUG=367418
TEST=
R=blundell@chromium.org,jochen@chromium.org,sdefresne@chromium.org
Review URL: https://codereview.chromium.org/1355983002
Cr-Commit-Position: refs/heads/master@{#351023}
Diffstat (limited to 'components/test_runner')
-rw-r--r-- | components/test_runner/test_runner.cc | 12 | ||||
-rw-r--r-- | components/test_runner/test_runner.h | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/components/test_runner/test_runner.cc b/components/test_runner/test_runner.cc index 00dc145..6733249 100644 --- a/components/test_runner/test_runner.cc +++ b/components/test_runner/test_runner.cc @@ -216,7 +216,7 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> { void SetXSSAuditorEnabled(bool enabled); void SetAllowUniversalAccessFromFileURLs(bool allow); void SetAllowFileAccessFromFileURLs(bool allow); - void OverridePreference(const std::string key, v8::Local<v8::Value> value); + void OverridePreference(const std::string& key, v8::Local<v8::Value> value); void SetAcceptLanguages(const std::string& accept_languages); void SetPluginsEnabled(bool enabled); void DumpEditingCallbacks(); @@ -292,7 +292,7 @@ class TestRunnerBindings : public gin::Wrappable<TestRunnerBindings> { void CopyImageAtAndCapturePixelsAsyncThen(int x, int y, v8::Local<v8::Function> callback); - void SetCustomTextOutput(std::string output); + void SetCustomTextOutput(const std::string& output); void SetViewSourceForFrame(const std::string& name, bool enabled); void SetBluetoothMockDataSet(const std::string& dataset_name); void SetBluetoothManualChooser(); @@ -1054,7 +1054,7 @@ void TestRunnerBindings::SetAllowFileAccessFromFileURLs(bool allow) { runner_->SetAllowFileAccessFromFileURLs(allow); } -void TestRunnerBindings::OverridePreference(const std::string key, +void TestRunnerBindings::OverridePreference(const std::string& key, v8::Local<v8::Value> value) { if (runner_) runner_->OverridePreference(key, value); @@ -1450,7 +1450,7 @@ void TestRunnerBindings::CopyImageAtAndCapturePixelsAsyncThen( runner_->CopyImageAtAndCapturePixelsAsyncThen(x, y, callback); } -void TestRunnerBindings::SetCustomTextOutput(std::string output) { +void TestRunnerBindings::SetCustomTextOutput(const std::string& output) { runner_->setCustomTextOutput(output); } @@ -1784,7 +1784,7 @@ std::string TestRunner::customDumpText() const { return custom_text_output_; } -void TestRunner::setCustomTextOutput(std::string text) { +void TestRunner::setCustomTextOutput(const std::string& text) { custom_text_output_ = text; has_custom_text_output_ = true; } @@ -2554,7 +2554,7 @@ void TestRunner::SetAllowFileAccessFromFileURLs(bool allow) { delegate_->ApplyPreferences(); } -void TestRunner::OverridePreference(const std::string key, +void TestRunner::OverridePreference(const std::string& key, v8::Local<v8::Value> value) { TestPreferences* prefs = delegate_->Preferences(); if (key == "WebKitDefaultFontSize") { diff --git a/components/test_runner/test_runner.h b/components/test_runner/test_runner.h index 4ea4ade..45ee51a 100644 --- a/components/test_runner/test_runner.h +++ b/components/test_runner/test_runner.h @@ -87,7 +87,7 @@ class TestRunner : public WebTestRunner, void ClearDevToolsLocalStorage(); void setShouldDumpAsText(bool); void setShouldDumpAsMarkup(bool); - void setCustomTextOutput(std::string text); + void setCustomTextOutput(const std::string& text); void setShouldGeneratePixelResults(bool); void setShouldDumpFrameLoadCallbacks(bool); void setShouldDumpPingLoaderCallbacks(bool); @@ -329,7 +329,7 @@ class TestRunner : public WebTestRunner, void SetXSSAuditorEnabled(bool enabled); void SetAllowUniversalAccessFromFileURLs(bool allow); void SetAllowFileAccessFromFileURLs(bool allow); - void OverridePreference(const std::string key, v8::Local<v8::Value> value); + void OverridePreference(const std::string& key, v8::Local<v8::Value> value); // Modify accept_languages in RendererPreferences. void SetAcceptLanguages(const std::string& accept_languages); |