Commit 9bce6bd1 authored by lazyboy's avatar lazyboy Committed by Commit bot

Prefix search code improvement in tab_capture_api.cc

BUG=None
Test=None, no visible change.

Review-Url: https://codereview.chromium.org/2619973002
Cr-Commit-Position: refs/heads/master@{#442774}
parent 9c22f660
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "base/command_line.h" #include "base/command_line.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/extensions/api/tab_capture/offscreen_tab.h" #include "chrome/browser/extensions/api/tab_capture/offscreen_tab.h"
...@@ -87,7 +88,7 @@ void FilterDeprecatedGoogConstraints(TabCapture::CaptureOptions* options) { ...@@ -87,7 +88,7 @@ void FilterDeprecatedGoogConstraints(TabCapture::CaptureOptions* options) {
std::vector<std::string> bad_keys; std::vector<std::string> bad_keys;
base::DictionaryValue::Iterator it(*dict); base::DictionaryValue::Iterator it(*dict);
for (; !it.IsAtEnd(); it.Advance()) { for (; !it.IsAtEnd(); it.Advance()) {
if (it.key().find("goog") == 0) if (base::StartsWith(it.key(), "goog", base::CompareCase::SENSITIVE))
bad_keys.push_back(it.key()); bad_keys.push_back(it.key());
} }
for (const std::string& k : bad_keys) { for (const std::string& k : bad_keys) {
......
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