| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_H_ |
| 6 #define EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_H_ | 6 #define EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 void OnOTRBrowserContextCreated(void* original_browser_context, | 303 void OnOTRBrowserContextCreated(void* original_browser_context, |
| 304 void* otr_browser_context); | 304 void* otr_browser_context); |
| 305 void OnOTRBrowserContextDestroyed(void* original_browser_context, | 305 void OnOTRBrowserContextDestroyed(void* original_browser_context, |
| 306 void* otr_browser_context); | 306 void* otr_browser_context); |
| 307 | 307 |
| 308 // Registers a |callback| that is executed when the next page load happens. | 308 // Registers a |callback| that is executed when the next page load happens. |
| 309 // The callback is then deleted. | 309 // The callback is then deleted. |
| 310 void AddCallbackForPageLoad(const base::Closure& callback); | 310 void AddCallbackForPageLoad(const base::Closure& callback); |
| 311 | 311 |
| 312 private: | 312 private: |
| 313 friend struct DefaultSingletonTraits<ExtensionWebRequestEventRouter>; | 313 friend struct base::DefaultSingletonTraits<ExtensionWebRequestEventRouter>; |
| 314 | 314 |
| 315 struct EventListener; | 315 struct EventListener; |
| 316 using EventListeners = std::vector<const EventListener*>; | 316 using EventListeners = std::vector<const EventListener*>; |
| 317 using ListenerMapForBrowserContext = | 317 using ListenerMapForBrowserContext = |
| 318 std::map<std::string, std::set<EventListener>>; | 318 std::map<std::string, std::set<EventListener>>; |
| 319 using ListenerMap = std::map<void*, ListenerMapForBrowserContext>; | 319 using ListenerMap = std::map<void*, ListenerMapForBrowserContext>; |
| 320 using BlockedRequestMap = std::map<uint64_t, BlockedRequest>; | 320 using BlockedRequestMap = std::map<uint64_t, BlockedRequest>; |
| 321 // Map of request_id -> bit vector of EventTypes already signaled | 321 // Map of request_id -> bit vector of EventTypes already signaled |
| 322 using SignaledRequestMap = std::map<uint64_t, int>; | 322 using SignaledRequestMap = std::map<uint64_t, int>; |
| 323 // For each browser_context: a bool indicating whether it is an incognito | 323 // For each browser_context: a bool indicating whether it is an incognito |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 extensions::QuotaLimitHeuristics* heuristics) const override; | 552 extensions::QuotaLimitHeuristics* heuristics) const override; |
| 553 // Handle quota exceeded gracefully: Only warn the user but still execute the | 553 // Handle quota exceeded gracefully: Only warn the user but still execute the |
| 554 // function. | 554 // function. |
| 555 void OnQuotaExceeded(const std::string& error) override; | 555 void OnQuotaExceeded(const std::string& error) override; |
| 556 bool RunSync() override; | 556 bool RunSync() override; |
| 557 }; | 557 }; |
| 558 | 558 |
| 559 } // namespace extensions | 559 } // namespace extensions |
| 560 | 560 |
| 561 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_H_ | 561 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_H_ |
| OLD | NEW |