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

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

Issue 1413543005: Use FrameTreeNode ID as frameId in extension APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Charlie's nits (#33) Created 5 years 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 <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 namespace net { 46 namespace net {
47 class AuthChallengeInfo; 47 class AuthChallengeInfo;
48 class AuthCredentials; 48 class AuthCredentials;
49 class HttpRequestHeaders; 49 class HttpRequestHeaders;
50 class HttpResponseHeaders; 50 class HttpResponseHeaders;
51 class URLRequest; 51 class URLRequest;
52 } 52 }
53 53
54 namespace extensions { 54 namespace extensions {
55 55
56 struct ExtensionApiFrameId;
56 class InfoMap; 57 class InfoMap;
57 class WebRequestRulesRegistry; 58 class WebRequestRulesRegistry;
58 class WebRequestEventRouterDelegate; 59 class WebRequestEventRouterDelegate;
59 60
60 // Support class for the WebRequest API. Lives on the UI thread. Most of the 61 // Support class for the WebRequest API. Lives on the UI thread. Most of the
61 // work is done by ExtensionWebRequestEventRouter below. This class observes 62 // work is done by ExtensionWebRequestEventRouter below. This class observes
62 // extensions::EventRouter to deal with event listeners. There is one instance 63 // extensions::EventRouter to deal with event listeners. There is one instance
63 // per BrowserContext which is shared with incognito. 64 // per BrowserContext which is shared with incognito.
64 class WebRequestAPI : public BrowserContextKeyedAPI, 65 class WebRequestAPI : public BrowserContextKeyedAPI,
65 public EventRouter::Observer { 66 public EventRouter::Observer {
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 // Ensures that future callbacks for |request| are ignored so that it can be 333 // Ensures that future callbacks for |request| are ignored so that it can be
333 // destroyed safely. 334 // destroyed safely.
334 void ClearPendingCallbacks(const net::URLRequest* request); 335 void ClearPendingCallbacks(const net::URLRequest* request);
335 336
336 bool DispatchEvent( 337 bool DispatchEvent(
337 void* browser_context, 338 void* browser_context,
338 net::URLRequest* request, 339 net::URLRequest* request,
339 const std::vector<const EventListener*>& listeners, 340 const std::vector<const EventListener*>& listeners,
340 const base::ListValue& args); 341 const base::ListValue& args);
341 342
343 void DispatchEventOnIO(void* browser_context,
344 scoped_ptr<std::vector<EventListener>> listeners,
345 base::DictionaryValue* dict,
346 const ExtensionApiFrameId& extension_api_frame_id);
347
342 // Returns a list of event listeners that care about the given event, based 348 // Returns a list of event listeners that care about the given event, based
343 // on their filter parameters. |extra_info_spec| will contain the combined 349 // on their filter parameters. |extra_info_spec| will contain the combined
344 // set of extra_info_spec flags that every matching listener asked for. 350 // set of extra_info_spec flags that every matching listener asked for.
345 std::vector<const EventListener*> GetMatchingListeners( 351 std::vector<const EventListener*> GetMatchingListeners(
346 void* browser_context, 352 void* browser_context,
347 const extensions::InfoMap* extension_info_map, 353 const extensions::InfoMap* extension_info_map,
348 const std::string& event_name, 354 const std::string& event_name,
349 const net::URLRequest* request, 355 const net::URLRequest* request,
350 int* extra_info_spec); 356 int* extra_info_spec);
351 357
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 extensions::QuotaLimitHeuristics* heuristics) const override; 558 extensions::QuotaLimitHeuristics* heuristics) const override;
553 // Handle quota exceeded gracefully: Only warn the user but still execute the 559 // Handle quota exceeded gracefully: Only warn the user but still execute the
554 // function. 560 // function.
555 void OnQuotaExceeded(const std::string& error) override; 561 void OnQuotaExceeded(const std::string& error) override;
556 bool RunSync() override; 562 bool RunSync() override;
557 }; 563 };
558 564
559 } // namespace extensions 565 } // namespace extensions
560 566
561 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_H_ 567 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698