OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/chromeos/file_system_provider/registry.h" | 5 #include "chrome/browser/chromeos/file_system_provider/registry.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 continue; | 221 continue; |
222 } | 222 } |
223 | 223 |
224 Watcher restored_watcher; | 224 Watcher restored_watcher; |
225 restored_watcher.entry_path = | 225 restored_watcher.entry_path = |
226 base::FilePath::FromUTF8Unsafe(entry_path); | 226 base::FilePath::FromUTF8Unsafe(entry_path); |
227 restored_watcher.recursive = recursive; | 227 restored_watcher.recursive = recursive; |
228 restored_watcher.last_tag = last_tag; | 228 restored_watcher.last_tag = last_tag; |
229 for (const auto& persistent_origin : *persistent_origins) { | 229 for (const auto& persistent_origin : *persistent_origins) { |
230 std::string origin; | 230 std::string origin; |
231 if (persistent_origin.GetAsString(&origin)) { | 231 if (persistent_origin->GetAsString(&origin)) { |
232 LOG(ERROR) << "Malformed subscriber information in preferences."; | 232 LOG(ERROR) << "Malformed subscriber information in preferences."; |
233 continue; | 233 continue; |
234 } | 234 } |
235 const GURL origin_as_gurl(origin); | 235 const GURL origin_as_gurl(origin); |
236 restored_watcher.subscribers[origin_as_gurl].origin = origin_as_gurl; | 236 restored_watcher.subscribers[origin_as_gurl].origin = origin_as_gurl; |
237 restored_watcher.subscribers[origin_as_gurl].persistent = true; | 237 restored_watcher.subscribers[origin_as_gurl].persistent = true; |
238 } | 238 } |
239 restored_file_system.watchers[WatcherKey( | 239 restored_file_system.watchers[WatcherKey( |
240 base::FilePath::FromUTF8Unsafe(entry_path), recursive)] = | 240 base::FilePath::FromUTF8Unsafe(entry_path), recursive)] = |
241 restored_watcher; | 241 restored_watcher; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 LOG(ERROR) << "Broken preferences detected while updating a tag."; | 275 LOG(ERROR) << "Broken preferences detected while updating a tag."; |
276 return; | 276 return; |
277 } | 277 } |
278 | 278 |
279 watcher_value->SetStringWithoutPathExpansion(kPrefKeyWatcherLastTag, | 279 watcher_value->SetStringWithoutPathExpansion(kPrefKeyWatcherLastTag, |
280 watcher.last_tag); | 280 watcher.last_tag); |
281 } | 281 } |
282 | 282 |
283 } // namespace file_system_provider | 283 } // namespace file_system_provider |
284 } // namespace chromeos | 284 } // namespace chromeos |
OLD | NEW |