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

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

Issue 2002763003: webRequest: reliably determine tabId (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@webRequest-testing-unload
Patch Set: Use FrameData + fix comments Created 4 years, 7 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_EVENT_DETAILS_H_ 5 #ifndef EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_EVENT_DETAILS_H_
6 #define EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_EVENT_DETAILS_H_ 6 #define EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_EVENT_DETAILS_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 void SetInteger(const std::string& key, int value) { 83 void SetInteger(const std::string& key, int value) {
84 dict_.SetInteger(key, value); 84 dict_.SetInteger(key, value);
85 } 85 }
86 86
87 void SetString(const std::string& key, const std::string& value) { 87 void SetString(const std::string& key, const std::string& value) {
88 dict_.SetString(key, value); 88 dict_.SetString(key, value);
89 } 89 }
90 90
91 // Sets the following keys using information from constructor. 91 // Sets the following keys using information from constructor.
92 // - tabId
92 // - frameId 93 // - frameId
93 // - parentFrameId 94 // - parentFrameId
94 // This must be called from the UI thread. 95 // This must be called from the UI thread.
95 void DetermineFrameIdOnUI(); 96 void DetermineFrameIdOnUI();
96 97
97 // Sets the following keys using information from constructor. 98 // Sets the following keys using information from constructor.
99 // - tabId
98 // - frameId 100 // - frameId
99 // - parentFrameId 101 // - parentFrameId
100 // 102 //
101 // This method is more expensive than DetermineFrameIdOnUI because it may 103 // This method is more expensive than DetermineFrameIdOnUI because it may
102 // involve thread hops, so prefer using DetermineFrameIdOnUI() when possible. 104 // involve thread hops, so prefer using DetermineFrameIdOnUI() when possible.
103 // The callback is called as soon as these IDs are determined, which can be 105 // The callback is called as soon as these IDs are determined, which can be
104 // synchronous or asynchronous. 106 // synchronous or asynchronous.
105 // 107 //
106 // The caller must not use or delete this WebRequestEventDetails instance 108 // The caller must not use or delete this WebRequestEventDetails instance
107 // after calling this method. Ownership of this instance is transferred to 109 // after calling this method. Ownership of this instance is transferred to
(...skipping 28 matching lines...) Expand all
136 // Used to determine the frameId and parentFrameId. 138 // Used to determine the frameId and parentFrameId.
137 int render_process_id_; 139 int render_process_id_;
138 int render_frame_id_; 140 int render_frame_id_;
139 141
140 DISALLOW_COPY_AND_ASSIGN(WebRequestEventDetails); 142 DISALLOW_COPY_AND_ASSIGN(WebRequestEventDetails);
141 }; 143 };
142 144
143 } // namespace extensions 145 } // namespace extensions
144 146
145 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_EVENT_DETAILS_H_ 147 #endif // EXTENSIONS_BROWSER_API_WEB_REQUEST_WEB_REQUEST_EVENT_DETAILS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698