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

Side by Side Diff: components/filesystem/public/cpp/prefs/filesystem_json_pref_store.cc

Issue 1635603002: Make use of CreateInterfacePtrAndBind() where appropriate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweaks Created 4 years, 10 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
« no previous file with comments | « components/filesystem/files_test_base.cc ('k') | components/web_view/frame_apptest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/filesystem/files_test_base.cc ('k') | components/web_view/frame_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698