| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_CROSS_SITE_REQUEST_MANAGER_H__ | 5 #ifndef CHROME_BROWSER_CROSS_SITE_REQUEST_MANAGER_H__ |
| 6 #define CHROME_BROWSER_CROSS_SITE_REQUEST_MANAGER_H__ | 6 #define CHROME_BROWSER_CROSS_SITE_REQUEST_MANAGER_H__ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // Called by ResourceDispatcherHost on the IO thread. | 27 // Called by ResourceDispatcherHost on the IO thread. |
| 28 bool HasPendingCrossSiteRequest(int renderer_id, int render_view_id); | 28 bool HasPendingCrossSiteRequest(int renderer_id, int render_view_id); |
| 29 | 29 |
| 30 // Sets whether the RenderViewHost specified by the given IDs currently has a | 30 // Sets whether the RenderViewHost specified by the given IDs currently has a |
| 31 // pending cross-site request. Called by RenderViewHost on the UI thread. | 31 // pending cross-site request. Called by RenderViewHost on the UI thread. |
| 32 void SetHasPendingCrossSiteRequest(int renderer_id, | 32 void SetHasPendingCrossSiteRequest(int renderer_id, |
| 33 int render_view_id, | 33 int render_view_id, |
| 34 bool has_pending); | 34 bool has_pending); |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 friend DefaultSingletonTraits<CrossSiteRequestManager>; | 37 friend class DefaultSingletonTraits<CrossSiteRequestManager>; |
| 38 typedef std::set<std::pair<int, int> > RenderViewSet; | 38 typedef std::set<std::pair<int, int> > RenderViewSet; |
| 39 | 39 |
| 40 // Obtain an instance of CrossSiteRequestManager via | 40 // Obtain an instance of CrossSiteRequestManager via |
| 41 // Singleton<CrossSiteRequestManager>(). | 41 // Singleton<CrossSiteRequestManager>(). |
| 42 CrossSiteRequestManager() {} | 42 CrossSiteRequestManager() {} |
| 43 | 43 |
| 44 // You must acquire this lock before reading or writing any members of this | 44 // You must acquire this lock before reading or writing any members of this |
| 45 // class. You must not block while holding this lock. | 45 // class. You must not block while holding this lock. |
| 46 Lock lock_; | 46 Lock lock_; |
| 47 | 47 |
| 48 // Set of (render_process_host_id, render_view_id) pairs of all | 48 // Set of (render_process_host_id, render_view_id) pairs of all |
| 49 // RenderViewHosts that have pending cross-site requests. Used to pass | 49 // RenderViewHosts that have pending cross-site requests. Used to pass |
| 50 // information about the RenderViewHosts between the UI and IO threads. | 50 // information about the RenderViewHosts between the UI and IO threads. |
| 51 RenderViewSet pending_cross_site_views_; | 51 RenderViewSet pending_cross_site_views_; |
| 52 | 52 |
| 53 DISALLOW_EVIL_CONSTRUCTORS(CrossSiteRequestManager); | 53 DISALLOW_EVIL_CONSTRUCTORS(CrossSiteRequestManager); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 #endif // CHROME_BROWSER_CROSS_SITE_REQUEST_MANAGER_H__ | 56 #endif // CHROME_BROWSER_CROSS_SITE_REQUEST_MANAGER_H__ |
| 57 | 57 |
| OLD | NEW |