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 "content/browser/background_sync/background_sync_context.h" | 5 #include "content/browser/background_sync/background_sync_context.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 BrowserThread::PostTask( | 49 BrowserThread::PostTask( |
50 BrowserThread::IO, FROM_HERE, | 50 BrowserThread::IO, FROM_HERE, |
51 base::Bind(&BackgroundSyncContext::CreateServiceOnIOThread, this, | 51 base::Bind(&BackgroundSyncContext::CreateServiceOnIOThread, this, |
52 base::Passed(&request))); | 52 base::Passed(&request))); |
53 } | 53 } |
54 | 54 |
55 void BackgroundSyncContext::ServiceHadConnectionError( | 55 void BackgroundSyncContext::ServiceHadConnectionError( |
56 BackgroundSyncServiceImpl* service) { | 56 BackgroundSyncServiceImpl* service) { |
57 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 57 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
58 DCHECK(ContainsValue(services_, service)); | 58 DCHECK(base::ContainsValue(services_, service)); |
59 | 59 |
60 services_.erase(service); | 60 services_.erase(service); |
61 delete service; | 61 delete service; |
62 } | 62 } |
63 | 63 |
64 BackgroundSyncManager* BackgroundSyncContext::background_sync_manager() const { | 64 BackgroundSyncManager* BackgroundSyncContext::background_sync_manager() const { |
65 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 65 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
66 | 66 |
67 return background_sync_manager_.get(); | 67 return background_sync_manager_.get(); |
68 } | 68 } |
(...skipping 16 matching lines...) Expand all Loading... |
85 void BackgroundSyncContext::CreateServiceOnIOThread( | 85 void BackgroundSyncContext::CreateServiceOnIOThread( |
86 mojo::InterfaceRequest<blink::mojom::BackgroundSyncService> request) { | 86 mojo::InterfaceRequest<blink::mojom::BackgroundSyncService> request) { |
87 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 87 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
88 DCHECK(background_sync_manager_); | 88 DCHECK(background_sync_manager_); |
89 services_.insert(new BackgroundSyncServiceImpl(this, std::move(request))); | 89 services_.insert(new BackgroundSyncServiceImpl(this, std::move(request))); |
90 } | 90 } |
91 | 91 |
92 void BackgroundSyncContext::ShutdownOnIO() { | 92 void BackgroundSyncContext::ShutdownOnIO() { |
93 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 93 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
94 | 94 |
95 STLDeleteElements(&services_); | 95 base::STLDeleteElements(&services_); |
96 background_sync_manager_.reset(); | 96 background_sync_manager_.reset(); |
97 } | 97 } |
98 | 98 |
99 } // namespace content | 99 } // namespace content |
OLD | NEW |