Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(537)

Side by Side Diff: extensions/browser/api/web_request/web_request_api.h

Issue 2749823002: Restore KeyedServiceFactory diagnostics for context use-after-destroy. (Closed)
Patch Set: Refactor SiteEngagementService tests. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <list> 10 #include <list>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // extensions::EventRouter to deal with event listeners. There is one instance 65 // extensions::EventRouter to deal with event listeners. There is one instance
66 // per BrowserContext which is shared with incognito. 66 // per BrowserContext which is shared with incognito.
67 class WebRequestAPI : public BrowserContextKeyedAPI, 67 class WebRequestAPI : public BrowserContextKeyedAPI,
68 public EventRouter::Observer { 68 public EventRouter::Observer {
69 public: 69 public:
70 explicit WebRequestAPI(content::BrowserContext* context); 70 explicit WebRequestAPI(content::BrowserContext* context);
71 ~WebRequestAPI() override; 71 ~WebRequestAPI() override;
72 72
73 // BrowserContextKeyedAPI support: 73 // BrowserContextKeyedAPI support:
74 static BrowserContextKeyedAPIFactory<WebRequestAPI>* GetFactoryInstance(); 74 static BrowserContextKeyedAPIFactory<WebRequestAPI>* GetFactoryInstance();
75 void Shutdown() override;
75 76
76 // EventRouter::Observer overrides: 77 // EventRouter::Observer overrides:
77 void OnListenerRemoved(const EventListenerInfo& details) override; 78 void OnListenerRemoved(const EventListenerInfo& details) override;
78 79
79 private: 80 private:
80 friend class BrowserContextKeyedAPIFactory<WebRequestAPI>; 81 friend class BrowserContextKeyedAPIFactory<WebRequestAPI>;
81 82
82 // BrowserContextKeyedAPI support: 83 // BrowserContextKeyedAPI support:
83 static const char* service_name() { return "WebRequestAPI"; } 84 static const char* service_name() { return "WebRequestAPI"; }
84 static const bool kServiceRedirectedInIncognito = true; 85 static const bool kServiceRedirectedInIncognito = true;
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 extensions::QuotaLimitHeuristics* heuristics) const override; 620 extensions::QuotaLimitHeuristics* heuristics) const override;
620 // Handle quota exceeded gracefully: Only warn the user but still execute the 621 // Handle quota exceeded gracefully: Only warn the user but still execute the
621 // function. 622 // function.
622 void OnQuotaExceeded(const std::string& error) override; 623 void OnQuotaExceeded(const std::string& error) override;
623 ResponseAction Run() override; 624 ResponseAction Run() override;
624 }; 625 };
625 626
626 } // namespace extensions 627 } // namespace extensions
627 628
628 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_H_ 629 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698