OLD | NEW |
---|---|
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 CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_NAVIGATION_OBSERVER_MANAGER_H _ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_NAVIGATION_OBSERVER_MANAGER_H _ |
6 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_NAVIGATION_OBSERVER_MANAGER_H _ | 6 #define CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_NAVIGATION_OBSERVER_MANAGER_H _ |
7 | 7 |
8 #include "base/feature_list.h" | 8 #include "base/feature_list.h" |
9 #include "chrome/common/safe_browsing/csd.pb.h" | 9 #include "chrome/common/safe_browsing/csd.pb.h" |
10 #include "content/public/browser/notification_observer.h" | 10 #include "content/public/browser/notification_observer.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 // delayed download in Window D. Before the download occurs, url2 in window B | 149 // delayed download in Window D. Before the download occurs, url2 in window B |
150 // opens a different about:blank page in window C. | 150 // opens a different about:blank page in window C. |
151 // A ---- C - D | 151 // A ---- C - D |
152 // \ / | 152 // \ / |
153 // B | 153 // B |
154 // In this case, FindNavigationEvent() will think url2 in Window B is the | 154 // In this case, FindNavigationEvent() will think url2 in Window B is the |
155 // referrer of about::blank in Window C since this navigation is more recent. | 155 // referrer of about::blank in Window C since this navigation is more recent. |
156 // However, it does not prevent us to attribute url1 in Window A as the cause | 156 // However, it does not prevent us to attribute url1 in Window A as the cause |
157 // of all these navigations. | 157 // of all these navigations. |
158 NavigationEvent* FindNavigationEvent(const GURL& target_url, | 158 NavigationEvent* FindNavigationEvent(const GURL& target_url, |
159 const GURL& target_main_frame_url, | |
Nathan Parker
2017/01/04 18:54:51
Mention this new arg in the comments
Jialiu Lin
2017/01/04 21:47:01
Done.
| |
159 int target_tab_id); | 160 int target_tab_id); |
160 | 161 |
161 void AddToReferrerChain(std::vector<ReferrerChainEntry>* referrer_chain, | 162 void AddToReferrerChain(std::vector<ReferrerChainEntry>* referrer_chain, |
162 NavigationEvent* nav_event, | 163 NavigationEvent* nav_event, |
163 ReferrerChainEntry::URLType type); | 164 ReferrerChainEntry::URLType type); |
164 | 165 |
165 // navigation_map_ keeps track of all the observed navigations. This map is | 166 // navigation_map_ keeps track of all the observed navigations. This map is |
166 // keyed on the resolved request url. In other words, in case of server | 167 // keyed on the resolved request url. In other words, in case of server |
167 // redirects, its key is the last server redirect url, otherwise, it is the | 168 // redirects, its key is the last server redirect url, otherwise, it is the |
168 // original target url. Since the same url can be requested multiple times | 169 // original target url. Since the same url can be requested multiple times |
(...skipping 17 matching lines...) Expand all Loading... | |
186 | 187 |
187 content::NotificationRegistrar registrar_; | 188 content::NotificationRegistrar registrar_; |
188 | 189 |
189 base::OneShotTimer cleanup_timer_; | 190 base::OneShotTimer cleanup_timer_; |
190 | 191 |
191 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingNavigationObserverManager); | 192 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingNavigationObserverManager); |
192 }; | 193 }; |
193 } // namespace safe_browsing | 194 } // namespace safe_browsing |
194 | 195 |
195 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_NAVIGATION_OBSERVER_MANAGE R_H_ | 196 #endif // CHROME_BROWSER_SAFE_BROWSING_SAFE_BROWSING_NAVIGATION_OBSERVER_MANAGE R_H_ |
OLD | NEW |