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

Side by Side Diff: extensions/browser/api/web_request/web_request_api.cc

Issue 1853283002: Map webRequest filter type to multiple internal ResourceTypes if needed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 (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 <utility> 10 #include <utility>
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 return false; 520 return false;
521 } 521 }
522 urls.AddPattern(pattern); 522 urls.AddPattern(pattern);
523 } 523 }
524 } else if (it.key() == "types") { 524 } else if (it.key() == "types") {
525 const base::ListValue* types_value = NULL; 525 const base::ListValue* types_value = NULL;
526 if (!it.value().GetAsList(&types_value)) 526 if (!it.value().GetAsList(&types_value))
527 return false; 527 return false;
528 for (size_t i = 0; i < types_value->GetSize(); ++i) { 528 for (size_t i = 0; i < types_value->GetSize(); ++i) {
529 std::string type_str; 529 std::string type_str;
530 content::ResourceType type;
531 if (!types_value->GetString(i, &type_str) || 530 if (!types_value->GetString(i, &type_str) ||
532 !helpers::ParseResourceType(type_str, &type)) { 531 !helpers::ParseResourceType(type_str, &types)) {
533 return false; 532 return false;
534 } 533 }
535 types.push_back(type);
536 } 534 }
537 } else if (it.key() == "tabId") { 535 } else if (it.key() == "tabId") {
538 if (!it.value().GetAsInteger(&tab_id)) 536 if (!it.value().GetAsInteger(&tab_id))
539 return false; 537 return false;
540 } else if (it.key() == "windowId") { 538 } else if (it.key() == "windowId") {
541 if (!it.value().GetAsInteger(&window_id)) 539 if (!it.value().GetAsInteger(&window_id))
542 return false; 540 return false;
543 } else { 541 } else {
544 return false; 542 return false;
545 } 543 }
(...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after
2289 // Continue gracefully. 2287 // Continue gracefully.
2290 RunSync(); 2288 RunSync();
2291 } 2289 }
2292 2290
2293 bool WebRequestHandlerBehaviorChangedFunction::RunSync() { 2291 bool WebRequestHandlerBehaviorChangedFunction::RunSync() {
2294 helpers::ClearCacheOnNavigation(); 2292 helpers::ClearCacheOnNavigation();
2295 return true; 2293 return true;
2296 } 2294 }
2297 2295
2298 } // namespace extensions 2296 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698