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

Side by Side Diff: chrome/browser/sxs_linux.cc

Issue 1127963002: Implement lossy pref behavior for JsonPrefStore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs-fix-flags
Patch Set: Created 5 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sxs_linux.h" 5 #include "chrome/browser/sxs_linux.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 base::SplitString(channels_contents, '\n', &user_data_dir_channels); 72 base::SplitString(channels_contents, '\n', &user_data_dir_channels);
73 73
74 if (std::find(user_data_dir_channels.begin(), 74 if (std::find(user_data_dir_channels.begin(),
75 user_data_dir_channels.end(), 75 user_data_dir_channels.end(),
76 product_channel_name) != user_data_dir_channels.end()) { 76 product_channel_name) != user_data_dir_channels.end()) {
77 // No need to do further disk writes if our channel mark is already present. 77 // No need to do further disk writes if our channel mark is already present.
78 return true; 78 return true;
79 } 79 }
80 80
81 user_data_dir_channels.push_back(product_channel_name); 81 user_data_dir_channels.push_back(product_channel_name);
82 return base::ImportantFileWriter::WriteFileAtomically( 82 return base::ImportantFileWriterImpl::WriteFileAtomically(
83 channels_path, 83 channels_path, JoinString(user_data_dir_channels, "\n"));
84 JoinString(user_data_dir_channels, "\n"));
85 } 84 }
86 85
87 } // namespace 86 } // namespace
88 87
89 namespace sxs_linux { 88 namespace sxs_linux {
90 89
91 void AddChannelMarkToUserDataDir() { 90 void AddChannelMarkToUserDataDir() {
92 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); 91 DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
93 base::FilePath user_data_dir; 92 base::FilePath user_data_dir;
94 if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { 93 if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 if (!base::Move(source_path, target_path)) { 147 if (!base::Move(source_path, target_path)) {
149 LOG(ERROR) << "Failed to rename '" << source_path.value() 148 LOG(ERROR) << "Failed to rename '" << source_path.value()
150 << "' to '" << target_path.value() << "'"; 149 << "' to '" << target_path.value() << "'";
151 return chrome::RESULT_CODE_SXS_MIGRATION_FAILED; 150 return chrome::RESULT_CODE_SXS_MIGRATION_FAILED;
152 } 151 }
153 152
154 return content::RESULT_CODE_NORMAL_EXIT; 153 return content::RESULT_CODE_NORMAL_EXIT;
155 } 154 }
156 155
157 } // namespace sxs_linux 156 } // namespace sxs_linux
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698