Chromium Code Reviews| 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_manager.h" | 5 #include "content/browser/background_sync/background_sync_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/barrier_closure.h" | 9 #include "base/barrier_closure.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 GetBrowserContextOnUIThread(std::move(service_worker_context)); | 89 GetBrowserContextOnUIThread(std::move(service_worker_context)); |
| 90 if (!browser_context) | 90 if (!browser_context) |
| 91 return blink::mojom::PermissionStatus::DENIED; | 91 return blink::mojom::PermissionStatus::DENIED; |
| 92 | 92 |
| 93 PermissionManager* permission_manager = | 93 PermissionManager* permission_manager = |
| 94 browser_context->GetPermissionManager(); | 94 browser_context->GetPermissionManager(); |
| 95 if (!permission_manager) | 95 if (!permission_manager) |
| 96 return blink::mojom::PermissionStatus::DENIED; | 96 return blink::mojom::PermissionStatus::DENIED; |
| 97 | 97 |
| 98 // The requesting origin always matches the embedding origin. | 98 // The requesting origin always matches the embedding origin. |
| 99 return permission_manager->GetPermissionStatus( | 99 return permission_manager->GetPermissionStatusForWorker( |
|
johnme
2017/06/12 10:18:20
Is this correct? It seems that this codepath appli
| |
| 100 PermissionType::BACKGROUND_SYNC, origin, origin); | 100 PermissionType::BACKGROUND_SYNC, origin); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void NotifyBackgroundSyncRegisteredOnUIThread( | 103 void NotifyBackgroundSyncRegisteredOnUIThread( |
| 104 scoped_refptr<ServiceWorkerContextWrapper> sw_context_wrapper, | 104 scoped_refptr<ServiceWorkerContextWrapper> sw_context_wrapper, |
| 105 const GURL& origin) { | 105 const GURL& origin) { |
| 106 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 106 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 107 | 107 |
| 108 BackgroundSyncController* background_sync_controller = | 108 BackgroundSyncController* background_sync_controller = |
| 109 GetBackgroundSyncControllerOnUIThread(std::move(sw_context_wrapper)); | 109 GetBackgroundSyncControllerOnUIThread(std::move(sw_context_wrapper)); |
| 110 | 110 |
| (...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1164 parameters_->max_sync_attempts = max_attempts; | 1164 parameters_->max_sync_attempts = max_attempts; |
| 1165 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, callback); | 1165 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, callback); |
| 1166 } | 1166 } |
| 1167 | 1167 |
| 1168 base::Closure BackgroundSyncManager::MakeEmptyCompletion() { | 1168 base::Closure BackgroundSyncManager::MakeEmptyCompletion() { |
| 1169 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 1169 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 1170 return op_scheduler_.WrapCallbackToRunNext(base::Bind(&base::DoNothing)); | 1170 return op_scheduler_.WrapCallbackToRunNext(base::Bind(&base::DoNothing)); |
| 1171 } | 1171 } |
| 1172 | 1172 |
| 1173 } // namespace content | 1173 } // namespace content |
| OLD | NEW |