| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/file_system_app.h" | 5 #include "components/filesystem/file_system_app.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "mojo/application/public/cpp/application_connection.h" | 9 #include "mojo/application/public/cpp/application_connection.h" |
| 10 #include "mojo/application/public/cpp/application_impl.h" | 10 #include "mojo/application/public/cpp/application_impl.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 void FileSystemApp::OnDirectoryConnectionError(DirectoryImpl* directory) { | 61 void FileSystemApp::OnDirectoryConnectionError(DirectoryImpl* directory) { |
| 62 for (std::vector<Client>::iterator it = client_mapping_.begin(); | 62 for (std::vector<Client>::iterator it = client_mapping_.begin(); |
| 63 it != client_mapping_.end(); ++it) { | 63 it != client_mapping_.end(); ++it) { |
| 64 if (it->directory_ == directory) { | 64 if (it->directory_ == directory) { |
| 65 client_mapping_.erase(it); | 65 client_mapping_.erase(it); |
| 66 | 66 |
| 67 if (in_shutdown_ && client_mapping_.empty()) { | 67 if (in_shutdown_ && client_mapping_.empty()) { |
| 68 // We just cleared the last directory after our shell connection went | 68 // We just cleared the last directory after our shell connection went |
| 69 // away. Time to shut ourselves down. | 69 // away. Time to shut ourselves down. |
| 70 app_->Quit(); | 70 app_->QuitNow(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 return; | 73 return; |
| 74 } | 74 } |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 | 77 |
| 78 FileSystemApp::Client::Client(DirectoryImpl* directory, | 78 FileSystemApp::Client::Client(DirectoryImpl* directory, |
| 79 FileSystemClientPtr fs_client) | 79 FileSystemClientPtr fs_client) |
| 80 : directory_(directory), | 80 : directory_(directory), |
| 81 fs_client_(fs_client.Pass()) { | 81 fs_client_(fs_client.Pass()) { |
| 82 } | 82 } |
| 83 | 83 |
| 84 FileSystemApp::Client::Client(Client&& rhs) | 84 FileSystemApp::Client::Client(Client&& rhs) |
| 85 : directory_(rhs.directory_), | 85 : directory_(rhs.directory_), |
| 86 fs_client_(rhs.fs_client_.Pass()) { | 86 fs_client_(rhs.fs_client_.Pass()) { |
| 87 } | 87 } |
| 88 | 88 |
| 89 FileSystemApp::Client::~Client() {} | 89 FileSystemApp::Client::~Client() {} |
| 90 | 90 |
| 91 FileSystemApp::Client& FileSystemApp::Client::operator=( | 91 FileSystemApp::Client& FileSystemApp::Client::operator=( |
| 92 FileSystemApp::Client&& rhs) { | 92 FileSystemApp::Client&& rhs) { |
| 93 directory_ = rhs.directory_; | 93 directory_ = rhs.directory_; |
| 94 fs_client_ = rhs.fs_client_.Pass(); | 94 fs_client_ = rhs.fs_client_.Pass(); |
| 95 return *this; | 95 return *this; |
| 96 } | 96 } |
| 97 | 97 |
| 98 } // namespace filesystem | 98 } // namespace filesystem |
| OLD | NEW |