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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 if (!directory_) { | 327 if (!directory_) { |
328 OpenFilesystem( | 328 OpenFilesystem( |
329 Bind(&FilesystemJsonPrefStore::OnTempFileWriteStart, AsWeakPtr())); | 329 Bind(&FilesystemJsonPrefStore::OnTempFileWriteStart, AsWeakPtr())); |
330 } else { | 330 } else { |
331 OnTempFileWriteStart(); | 331 OnTempFileWriteStart(); |
332 } | 332 } |
333 } | 333 } |
334 | 334 |
335 void FilesystemJsonPrefStore::OpenFilesystem(base::Closure callback) { | 335 void FilesystemJsonPrefStore::OpenFilesystem(base::Closure callback) { |
336 filesystem::mojom::FileSystemClientPtr client; | 336 filesystem::mojom::FileSystemClientPtr client; |
337 binding_.Bind(GetProxy(&client)); | 337 binding_.Bind(MakeRequest(&client)); |
338 | 338 |
339 filesystem_->OpenFileSystem( | 339 filesystem_->OpenFileSystem( |
340 "origin", GetProxy(&directory_), std::move(client), | 340 "origin", MakeRequest(&directory_), std::move(client), |
341 base::Bind(&FilesystemJsonPrefStore::OnOpenFilesystem, AsWeakPtr(), | 341 base::Bind(&FilesystemJsonPrefStore::OnOpenFilesystem, AsWeakPtr(), |
342 callback)); | 342 callback)); |
343 } | 343 } |
344 | 344 |
345 void FilesystemJsonPrefStore::OnOpenFilesystem(base::Closure callback, | 345 void FilesystemJsonPrefStore::OnOpenFilesystem(base::Closure callback, |
346 mojom::FileError err) { | 346 mojom::FileError err) { |
347 if (err != mojom::FileError::OK) { | 347 if (err != mojom::FileError::OK) { |
348 // Do real error checking. | 348 // Do real error checking. |
349 NOTIMPLEMENTED(); | 349 NOTIMPLEMENTED(); |
350 return; | 350 return; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 reinterpret_cast<char*>(&contents.front()), contents.size())); | 416 reinterpret_cast<char*>(&contents.front()), contents.size())); |
417 read_result->value = deserializer.Deserialize(&error_code, &error_msg); | 417 read_result->value = deserializer.Deserialize(&error_code, &error_msg); |
418 read_result->error = HandleReadErrors(read_result->value.get()); | 418 read_result->error = HandleReadErrors(read_result->value.get()); |
419 } | 419 } |
420 } | 420 } |
421 | 421 |
422 OnFileRead(std::move(read_result)); | 422 OnFileRead(std::move(read_result)); |
423 } | 423 } |
424 | 424 |
425 } // namespace filesystem | 425 } // namespace filesystem |
OLD | NEW |