Chromium Code Reviews| Index: chrome/browser/safe_browsing/safe_browsing_navigation_observer.h |
| diff --git a/chrome/browser/safe_browsing/safe_browsing_navigation_observer.h b/chrome/browser/safe_browsing/safe_browsing_navigation_observer.h |
| index f08f42ef8d1c812dd1396bebf4c36b7f884b0aed..469cf165e8052ec6e029450f11822a9852472e4b 100644 |
| --- a/chrome/browser/safe_browsing/safe_browsing_navigation_observer.h |
| +++ b/chrome/browser/safe_browsing/safe_browsing_navigation_observer.h |
| @@ -33,10 +33,6 @@ struct NavigationEvent { |
| // same as source_url, if source_url was loaded |
| // in main frame. |
| GURL original_request_url; // The original request URL of this navigation. |
| - GURL destination_url; // The actual destination url of this navigation |
| - // event. If this navigation has server side |
| - // redirect(s), actual_target_url will be |
| - // different from initial_request_url. |
| int source_tab_id; // Which tab contains the frame with source_url. Tab ID is |
| // returned by SessionTabHelper::IdForTab. This ID is |
| // immutable for a given tab and unique across Chrome |
| @@ -48,6 +44,14 @@ struct NavigationEvent { |
| bool is_user_initiated; // browser_initiated || has_user_gesture. |
| bool has_committed; |
| bool has_server_redirect; |
| + std::vector<GURL> server_redirect_urls; // Server redirect url chain, |
| + // including the final destination |
|
Nathan Parker
2017/01/20 23:36:20
Maybe say in the comments where in the list the fi
Jialiu Lin
2017/01/21 00:48:27
You're right, the has_server_redirect boolean is r
|
| + // url. |
| + GURL GetDestinationUrl() const { |
|
Nathan Parker
2017/01/20 23:36:20
This could return a const GURL& so it doesn't get
Jialiu Lin
2017/01/21 00:48:27
Done.
|
| + if (has_server_redirect && !server_redirect_urls.empty()) |
| + return server_redirect_urls.back(); |
| + return original_request_url; |
|
Nathan Parker
2017/01/20 23:36:20
nit: add an else to make it a bit more readable
Jialiu Lin
2017/01/21 00:48:27
Done.
|
| + } |
| }; |
| // Structure to keep track of resolved IP address of a host. |