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

Side by Side Diff: chrome/browser/chromeos/disks/disk_mount_manager.cc

Issue 10008100: gdata: Support mouting archive file in GData cache (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: gdata: Support mounting archive files under GData cache Created 8 years, 8 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 (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 "chrome/browser/chromeos/disks/disk_mount_manager.h" 5 #include "chrome/browser/chromeos/disks/disk_mount_manager.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 9
10 #include <sys/statvfs.h> 10 #include <sys/statvfs.h>
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 observers_.AddObserver(observer); 51 observers_.AddObserver(observer);
52 } 52 }
53 53
54 // DiskMountManager override. 54 // DiskMountManager override.
55 virtual void RemoveObserver(Observer* observer) OVERRIDE { 55 virtual void RemoveObserver(Observer* observer) OVERRIDE {
56 observers_.RemoveObserver(observer); 56 observers_.RemoveObserver(observer);
57 } 57 }
58 58
59 // DiskMountManager override. 59 // DiskMountManager override.
60 virtual void MountPath(const std::string& source_path, 60 virtual void MountPath(const std::string& source_path,
61 const std::string& source_name,
Ben Chan 2012/04/17 20:57:53 |source_name| -> |source_format|
61 MountType type) OVERRIDE { 62 MountType type) OVERRIDE {
62 // Hidden and non-existent devices should not be mounted. 63 // Hidden and non-existent devices should not be mounted.
63 if (type == MOUNT_TYPE_DEVICE) { 64 if (type == MOUNT_TYPE_DEVICE) {
64 DiskMap::const_iterator it = disks_.find(source_path); 65 DiskMap::const_iterator it = disks_.find(source_path);
65 if (it == disks_.end() || it->second->is_hidden()) { 66 if (it == disks_.end() || it->second->is_hidden()) {
66 OnMountCompleted(MOUNT_ERROR_INTERNAL, source_path, type, ""); 67 OnMountCompleted(MOUNT_ERROR_INTERNAL, source_path, type, "");
67 return; 68 return;
68 } 69 }
69 } 70 }
70 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 71 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
71 cros_disks_client_->Mount( 72 cros_disks_client_->Mount(
72 source_path, 73 source_path,
74 source_name,
73 type, 75 type,
74 // When succeeds, OnMountCompleted will be called by 76 // When succeeds, OnMountCompleted will be called by
75 // "MountCompleted" signal instead. 77 // "MountCompleted" signal instead.
76 base::Bind(&base::DoNothing), 78 base::Bind(&base::DoNothing),
77 base::Bind(&DiskMountManagerImpl::OnMountCompleted, 79 base::Bind(&DiskMountManagerImpl::OnMountCompleted,
78 weak_ptr_factory_.GetWeakPtr(), 80 weak_ptr_factory_.GetWeakPtr(),
79 MOUNT_ERROR_INTERNAL, 81 MOUNT_ERROR_INTERNAL,
80 source_path, 82 source_path,
81 type, 83 type,
82 "")); 84 ""));
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 VLOG(1) << "DiskMountManager Shutdown completed"; 685 VLOG(1) << "DiskMountManager Shutdown completed";
684 } 686 }
685 687
686 // static 688 // static
687 DiskMountManager* DiskMountManager::GetInstance() { 689 DiskMountManager* DiskMountManager::GetInstance() {
688 return g_disk_mount_manager; 690 return g_disk_mount_manager;
689 } 691 }
690 692
691 } // namespace disks 693 } // namespace disks
692 } // namespace chromeos 694 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698