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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 } | 125 } |
126 | 126 |
127 bool IsWebRequestEvent(const std::string& event_name) { | 127 bool IsWebRequestEvent(const std::string& event_name) { |
128 std::string web_request_event_name(event_name); | 128 std::string web_request_event_name(event_name); |
129 if (base::StartsWith(web_request_event_name, | 129 if (base::StartsWith(web_request_event_name, |
130 webview::kWebViewEventPrefix, | 130 webview::kWebViewEventPrefix, |
131 base::CompareCase::SENSITIVE)) { | 131 base::CompareCase::SENSITIVE)) { |
132 web_request_event_name.replace( | 132 web_request_event_name.replace( |
133 0, strlen(webview::kWebViewEventPrefix), kWebRequestEventPrefix); | 133 0, strlen(webview::kWebViewEventPrefix), kWebRequestEventPrefix); |
134 } | 134 } |
135 const auto web_request_events_end = | 135 auto* const* web_request_events_end = |
136 kWebRequestEvents + arraysize(kWebRequestEvents); | 136 kWebRequestEvents + arraysize(kWebRequestEvents); |
137 return std::find(kWebRequestEvents, web_request_events_end, | 137 return std::find(kWebRequestEvents, web_request_events_end, |
138 web_request_event_name) != web_request_events_end; | 138 web_request_event_name) != web_request_events_end; |
139 } | 139 } |
140 | 140 |
141 // Returns whether |request| has been triggered by an extension in | 141 // Returns whether |request| has been triggered by an extension in |
142 // |extension_info_map|. | 142 // |extension_info_map|. |
143 bool IsRequestFromExtension(const net::URLRequest* request, | 143 bool IsRequestFromExtension(const net::URLRequest* request, |
144 const InfoMap* extension_info_map) { | 144 const InfoMap* extension_info_map) { |
145 // |extension_info_map| is NULL for system-level requests. | 145 // |extension_info_map| is NULL for system-level requests. |
(...skipping 2119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2265 // Continue gracefully. | 2265 // Continue gracefully. |
2266 RunSync(); | 2266 RunSync(); |
2267 } | 2267 } |
2268 | 2268 |
2269 bool WebRequestHandlerBehaviorChangedFunction::RunSync() { | 2269 bool WebRequestHandlerBehaviorChangedFunction::RunSync() { |
2270 helpers::ClearCacheOnNavigation(); | 2270 helpers::ClearCacheOnNavigation(); |
2271 return true; | 2271 return true; |
2272 } | 2272 } |
2273 | 2273 |
2274 } // namespace extensions | 2274 } // namespace extensions |
OLD | NEW |