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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 566763002: Use a std::string to store return value from FieldTrialList::FindFullName() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added warning comment. Created 6 years, 3 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index fc9377f532558f7b71848ea4c054b63bdf2c258d..bfff171e89ab09c40a72da829ad6550643abebd8 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -1384,8 +1384,11 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
const char kEnabledHttpOnlyGroupName[] = "EnabledHttpOnly";
const char kDisabledAllGroupName[] = "DisabledAll";
- base::StringPiece sdch_trial_group =
+ // Store in a string on return to keep underlying storage for
+ // StringPiece stable.
+ std::string sdch_trial_group_string =
base::FieldTrialList::FindFullName(kSdchFieldTrialName);
+ base::StringPiece sdch_trial_group(sdch_trial_group_string);
if (sdch_trial_group.starts_with(kEnabledAllGroupName)) {
net::SdchManager::EnableSecureSchemeSupport(true);
net::SdchManager::EnableSdchSupport(true);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698