| 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/shell/browser/layout_test/layout_test_permission_manager.h" | 5 #include "content/shell/browser/layout_test/layout_test_permission_manager.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 const GURL& requesting_origin, | 107 const GURL& requesting_origin, |
| 108 const GURL& embedding_origin) { | 108 const GURL& embedding_origin) { |
| 109 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 109 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 110 | 110 |
| 111 base::AutoLock lock(permissions_lock_); | 111 base::AutoLock lock(permissions_lock_); |
| 112 | 112 |
| 113 auto it = permissions_.find( | 113 auto it = permissions_.find( |
| 114 PermissionDescription(permission, requesting_origin, embedding_origin)); | 114 PermissionDescription(permission, requesting_origin, embedding_origin)); |
| 115 if (it == permissions_.end()) | 115 if (it == permissions_.end()) |
| 116 return; | 116 return; |
| 117 permissions_.erase(it);; | 117 permissions_.erase(it); |
| 118 } | 118 } |
| 119 | 119 |
| 120 PermissionStatus LayoutTestPermissionManager::GetPermissionStatus( | 120 PermissionStatus LayoutTestPermissionManager::GetPermissionStatus( |
| 121 PermissionType permission, | 121 PermissionType permission, |
| 122 const GURL& requesting_origin, | 122 const GURL& requesting_origin, |
| 123 const GURL& embedding_origin) { | 123 const GURL& embedding_origin) { |
| 124 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || | 124 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || |
| 125 BrowserThread::CurrentlyOn(BrowserThread::IO)); | 125 BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 126 | 126 |
| 127 base::AutoLock lock(permissions_lock_); | 127 base::AutoLock lock(permissions_lock_); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 // Add the callback to |callbacks| which will be run after the loop to | 214 // Add the callback to |callbacks| which will be run after the loop to |
| 215 // prevent re-entrance issues. | 215 // prevent re-entrance issues. |
| 216 callbacks.push_back(base::Bind(subscription->callback, status)); | 216 callbacks.push_back(base::Bind(subscription->callback, status)); |
| 217 } | 217 } |
| 218 | 218 |
| 219 for (const auto& callback : callbacks) | 219 for (const auto& callback : callbacks) |
| 220 callback.Run(); | 220 callback.Run(); |
| 221 } | 221 } |
| 222 | 222 |
| 223 } // namespace content | 223 } // namespace content |
| OLD | NEW |