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 // The main point of this class is to cache ARC proc nspid<->pid mapping | 5 // The main point of this class is to cache ARC proc nspid<->pid mapping |
6 // globally. Since the calculation is costly, a dedicated worker thread is | 6 // globally. Since the calculation is costly, a dedicated worker thread is |
7 // used. All read/write of its internal data structure (i.e., the mapping) | 7 // used. All read/write of its internal data structure (i.e., the mapping) |
8 // should be on this thread. | 8 // should be on this thread. |
9 | 9 |
10 #include "chrome/browser/chromeos/arc/process/arc_process_service.h" | 10 #include "chrome/browser/chromeos/arc/process/arc_process_service.h" |
11 | 11 |
12 #include <algorithm> | 12 #include <algorithm> |
13 #include <queue> | 13 #include <queue> |
14 #include <string> | 14 #include <string> |
15 #include <unordered_map> | 15 #include <unordered_map> |
16 #include <unordered_set> | 16 #include <unordered_set> |
17 #include <utility> | 17 #include <utility> |
18 | 18 |
19 #include "base/callback.h" | 19 #include "base/callback.h" |
20 #include "base/logging.h" | 20 #include "base/logging.h" |
21 #include "base/process/process.h" | 21 #include "base/process/process.h" |
22 #include "base/process/process_iterator.h" | 22 #include "base/process/process_iterator.h" |
23 #include "base/task_runner_util.h" | 23 #include "base/task_runner_util.h" |
24 #include "base/threading/sequenced_worker_pool.h" | |
25 #include "base/trace_event/trace_event.h" | 24 #include "base/trace_event/trace_event.h" |
26 #include "components/arc/arc_bridge_service.h" | 25 #include "components/arc/arc_bridge_service.h" |
27 #include "content/public/browser/browser_thread.h" | 26 #include "content/public/browser/browser_thread.h" |
28 | 27 |
29 namespace arc { | 28 namespace arc { |
30 | 29 |
31 using base::kNullProcessId; | 30 using base::kNullProcessId; |
32 using base::Process; | 31 using base::Process; |
33 using base::ProcessId; | 32 using base::ProcessId; |
34 using std::vector; | 33 using std::vector; |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 void ArcProcessService::OnInstanceClosed() { | 279 void ArcProcessService::OnInstanceClosed() { |
281 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 280 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
282 instance_ready_ = false; | 281 instance_ready_ = false; |
283 } | 282 } |
284 | 283 |
285 inline ArcProcessService::NSPidToPidMap::NSPidToPidMap() {} | 284 inline ArcProcessService::NSPidToPidMap::NSPidToPidMap() {} |
286 | 285 |
287 inline ArcProcessService::NSPidToPidMap::~NSPidToPidMap() {} | 286 inline ArcProcessService::NSPidToPidMap::~NSPidToPidMap() {} |
288 | 287 |
289 } // namespace arc | 288 } // namespace arc |
OLD | NEW |