OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/arc/test/fake_file_system_instance.h" | 5 #include "components/arc/test/fake_file_system_instance.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 #include <unistd.h> | 8 #include <unistd.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 DCHECK_EQ(0u, documents_.count(key)); | 114 DCHECK_EQ(0u, documents_.count(key)); |
115 documents_.insert(std::make_pair(key, document)); | 115 documents_.insert(std::make_pair(key, document)); |
116 child_documents_[key]; // Allocate a vector. | 116 child_documents_[key]; // Allocate a vector. |
117 if (!document.parent_document_id.empty()) { | 117 if (!document.parent_document_id.empty()) { |
118 DocumentKey parent_key(document.authority, document.parent_document_id); | 118 DocumentKey parent_key(document.authority, document.parent_document_id); |
119 DCHECK_EQ(1u, documents_.count(parent_key)); | 119 DCHECK_EQ(1u, documents_.count(parent_key)); |
120 child_documents_[parent_key].push_back(key); | 120 child_documents_[parent_key].push_back(key); |
121 } | 121 } |
122 } | 122 } |
123 | 123 |
124 void FakeFileSystemInstance::TriggerWatchers(const std::string& authority, | 124 void FakeFileSystemInstance::TriggerWatchers( |
125 const std::string& document_id, | 125 const std::string& authority, |
126 mojom::ChangeType type) { | 126 const std::string& document_id, |
| 127 storage::WatcherManager::ChangeType type) { |
127 DCHECK(thread_checker_.CalledOnValidThread()); | 128 DCHECK(thread_checker_.CalledOnValidThread()); |
128 if (!host_) { | 129 if (!host_) { |
129 LOG(ERROR) << "FileSystemHost is not available."; | 130 LOG(ERROR) << "FileSystemHost is not available."; |
130 return; | 131 return; |
131 } | 132 } |
132 auto iter = document_to_watchers_.find(DocumentKey(authority, document_id)); | 133 auto iter = document_to_watchers_.find(DocumentKey(authority, document_id)); |
133 if (iter == document_to_watchers_.end()) | 134 if (iter == document_to_watchers_.end()) |
134 return; | 135 return; |
135 for (int64_t watcher_id : iter->second) { | 136 for (int64_t watcher_id : iter->second) { |
136 host_->OnDocumentChanged(watcher_id, type); | 137 host_->OnDocumentChanged(watcher_id, type); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 base::Bind(callback, true)); | 258 base::Bind(callback, true)); |
258 } | 259 } |
259 | 260 |
260 void FakeFileSystemInstance::RequestMediaScan( | 261 void FakeFileSystemInstance::RequestMediaScan( |
261 const std::vector<std::string>& paths) { | 262 const std::vector<std::string>& paths) { |
262 DCHECK(thread_checker_.CalledOnValidThread()); | 263 DCHECK(thread_checker_.CalledOnValidThread()); |
263 // Do nothing and pretend we scaned them. | 264 // Do nothing and pretend we scaned them. |
264 } | 265 } |
265 | 266 |
266 } // namespace arc | 267 } // namespace arc |
OLD | NEW |