| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "components/filesystem/public/cpp/prefs/filesystem_json_pref_store.h" | 5 #include "components/filesystem/public/cpp/prefs/filesystem_json_pref_store.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 void FilesystemJsonPrefStore::PerformWrite() { | 320 void FilesystemJsonPrefStore::PerformWrite() { |
| 321 if (!directory_) { | 321 if (!directory_) { |
| 322 OpenFilesystem( | 322 OpenFilesystem( |
| 323 Bind(&FilesystemJsonPrefStore::OnTempFileWriteStart, AsWeakPtr())); | 323 Bind(&FilesystemJsonPrefStore::OnTempFileWriteStart, AsWeakPtr())); |
| 324 } else { | 324 } else { |
| 325 OnTempFileWriteStart(); | 325 OnTempFileWriteStart(); |
| 326 } | 326 } |
| 327 } | 327 } |
| 328 | 328 |
| 329 void FilesystemJsonPrefStore::OpenFilesystem(base::Closure callback) { | 329 void FilesystemJsonPrefStore::OpenFilesystem(base::Closure callback) { |
| 330 filesystem::FileSystemClientPtr client; | |
| 331 binding_.Bind(GetProxy(&client)); | |
| 332 | |
| 333 filesystem_->OpenFileSystem( | 330 filesystem_->OpenFileSystem( |
| 334 "origin", GetProxy(&directory_), std::move(client), | 331 "origin", GetProxy(&directory_), binding_.CreateInterfacePtrAndBind(), |
| 335 base::Bind(&FilesystemJsonPrefStore::OnOpenFilesystem, AsWeakPtr(), | 332 base::Bind(&FilesystemJsonPrefStore::OnOpenFilesystem, AsWeakPtr(), |
| 336 callback)); | 333 callback)); |
| 337 } | 334 } |
| 338 | 335 |
| 339 void FilesystemJsonPrefStore::OnOpenFilesystem(base::Closure callback, | 336 void FilesystemJsonPrefStore::OnOpenFilesystem(base::Closure callback, |
| 340 FileError err) { | 337 FileError err) { |
| 341 if (err != FileError::OK) { | 338 if (err != FileError::OK) { |
| 342 // Do real error checking. | 339 // Do real error checking. |
| 343 NOTIMPLEMENTED(); | 340 NOTIMPLEMENTED(); |
| 344 return; | 341 return; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 read_result->error = HandleReadErrors(read_result->value.get()); | 440 read_result->error = HandleReadErrors(read_result->value.get()); |
| 444 } | 441 } |
| 445 } | 442 } |
| 446 | 443 |
| 447 preferences_file_.reset(); | 444 preferences_file_.reset(); |
| 448 | 445 |
| 449 OnFileRead(std::move(read_result)); | 446 OnFileRead(std::move(read_result)); |
| 450 } | 447 } |
| 451 | 448 |
| 452 } // namespace filesystem | 449 } // namespace filesystem |
| OLD | NEW |