| OLD | NEW |
| 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 #include "extensions/browser/api/web_request/web_request_api.h" | 5 #include "extensions/browser/api/web_request/web_request_api.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 960 OnCompleted(browser_context, extension_info_map, request, | 960 OnCompleted(browser_context, extension_info_map, request, |
| 961 request->status().error()); | 961 request->status().error()); |
| 962 } | 962 } |
| 963 | 963 |
| 964 void ExtensionWebRequestEventRouter::OnErrorOccurred( | 964 void ExtensionWebRequestEventRouter::OnErrorOccurred( |
| 965 void* browser_context, | 965 void* browser_context, |
| 966 const InfoMap* extension_info_map, | 966 const InfoMap* extension_info_map, |
| 967 net::URLRequest* request, | 967 net::URLRequest* request, |
| 968 bool started, | 968 bool started, |
| 969 int net_error) { | 969 int net_error) { |
| 970 ExtensionsBrowserClient* client = ExtensionsBrowserClient::Get(); |
| 971 if (!client) { |
| 972 // |client| could be NULL during shutdown. |
| 973 return; |
| 974 } |
| 970 ExtensionNavigationUIData* navigation_ui_data = | 975 ExtensionNavigationUIData* navigation_ui_data = |
| 971 ExtensionsBrowserClient::Get()->GetExtensionNavigationUIData(request); | 976 client->GetExtensionNavigationUIData(request); |
| 972 // We hide events from the system context as well as sensitive requests. | 977 // We hide events from the system context as well as sensitive requests. |
| 973 // However, if the request first became sensitive after redirecting we have | 978 // However, if the request first became sensitive after redirecting we have |
| 974 // already signaled it and thus we have to signal the end of it. This is | 979 // already signaled it and thus we have to signal the end of it. This is |
| 975 // risk-free because the handler cannot modify the request now. | 980 // risk-free because the handler cannot modify the request now. |
| 976 if (!browser_context || | 981 if (!browser_context || |
| 977 (WebRequestPermissions::HideRequest(extension_info_map, request, | 982 (WebRequestPermissions::HideRequest(extension_info_map, request, |
| 978 navigation_ui_data) && | 983 navigation_ui_data) && |
| 979 !WasSignaled(*request))) { | 984 !WasSignaled(*request))) { |
| 980 return; | 985 return; |
| 981 } | 986 } |
| (...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2354 // Since EventListeners are segmented by browser_context, check that | 2359 // Since EventListeners are segmented by browser_context, check that |
| 2355 // last, as it is exceedingly unlikely to be different. | 2360 // last, as it is exceedingly unlikely to be different. |
| 2356 return extension_id == that.extension_id && | 2361 return extension_id == that.extension_id && |
| 2357 sub_event_name == that.sub_event_name && | 2362 sub_event_name == that.sub_event_name && |
| 2358 web_view_instance_id == that.web_view_instance_id && | 2363 web_view_instance_id == that.web_view_instance_id && |
| 2359 embedder_process_id == that.embedder_process_id && | 2364 embedder_process_id == that.embedder_process_id && |
| 2360 browser_context == that.browser_context; | 2365 browser_context == that.browser_context; |
| 2361 } | 2366 } |
| 2362 | 2367 |
| 2363 } // namespace extensions | 2368 } // namespace extensions |
| OLD | NEW |