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

Side by Side Diff: extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc

Issue 1594973004: Remove use of void** from HttpResponseHeaders::EnumerateHeaderLines (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 4 years, 11 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/declarative_webrequest/webrequest_condition_att ribute.h" 5 #include "extensions/browser/api/declarative_webrequest/webrequest_condition_att ribute.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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 request_data.original_response_headers; 687 request_data.original_response_headers;
688 if (headers == NULL) { 688 if (headers == NULL) {
689 // Each header of an empty set satisfies (the negation of) everything; 689 // Each header of an empty set satisfies (the negation of) everything;
690 // OTOH, there is no header to satisfy even the most permissive test. 690 // OTOH, there is no header to satisfy even the most permissive test.
691 return !positive_; 691 return !positive_;
692 } 692 }
693 693
694 bool passed = false; // Did some header pass TestNameValue? 694 bool passed = false; // Did some header pass TestNameValue?
695 std::string name; 695 std::string name;
696 std::string value; 696 std::string value;
697 void* iter = NULL; 697 size_t iter = 0;
698 while (!passed && headers->EnumerateHeaderLines(&iter, &name, &value)) { 698 while (!passed && headers->EnumerateHeaderLines(&iter, &name, &value)) {
699 passed |= header_matcher_->TestNameValue(name, value); 699 passed |= header_matcher_->TestNameValue(name, value);
700 } 700 }
701 701
702 return (positive_ ? passed : !passed); 702 return (positive_ ? passed : !passed);
703 } 703 }
704 704
705 WebRequestConditionAttribute::Type 705 WebRequestConditionAttribute::Type
706 WebRequestConditionAttributeResponseHeaders::GetType() const { 706 WebRequestConditionAttributeResponseHeaders::GetType() const {
707 return CONDITION_RESPONSE_HEADERS; 707 return CONDITION_RESPONSE_HEADERS;
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 bool WebRequestConditionAttributeStages::Equals( 876 bool WebRequestConditionAttributeStages::Equals(
877 const WebRequestConditionAttribute* other) const { 877 const WebRequestConditionAttribute* other) const {
878 if (!WebRequestConditionAttribute::Equals(other)) 878 if (!WebRequestConditionAttribute::Equals(other))
879 return false; 879 return false;
880 const WebRequestConditionAttributeStages* casted_other = 880 const WebRequestConditionAttributeStages* casted_other =
881 static_cast<const WebRequestConditionAttributeStages*>(other); 881 static_cast<const WebRequestConditionAttributeStages*>(other);
882 return allowed_stages_ == casted_other->allowed_stages_; 882 return allowed_stages_ == casted_other->allowed_stages_;
883 } 883 }
884 884
885 } // namespace extensions 885 } // namespace extensions
OLDNEW
« no previous file with comments | « content/shell/browser/shell_devtools_frontend.cc ('k') | extensions/browser/api/mime_handler_private/mime_handler_private.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698