Skip to content

Commit

Permalink
Avoid duplicate functions/code in core/inspector: isErrorStatusCode
Browse files Browse the repository at this point in the history
While experimenting with unity builds I encountered a few duplicate
symbols and functions in core/inspector. One of them was
isErrorStatusCode, a one instruction function that was defined in both
NetworkResourcesData.cpp and InspectorNetworkAgent.cpp.

This patch renames one of them IsHTTPErrorStatusCode, a more suitable
name.

Review-Url: https://codereview.chromium.org/2807533005
Cr-Commit-Position: refs/heads/master@{#464076}
  • Loading branch information
bratell-at-opera authored and Commit bot committed Apr 12, 2017
1 parent 89906c8 commit 4624411
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

namespace blink {

static bool IsErrorStatusCode(int status_code) {
static bool IsHTTPErrorStatusCode(int status_code) {
return status_code >= 400;
}

Expand Down Expand Up @@ -138,7 +138,8 @@ void NetworkResourcesData::ResourceData::ClearWeakMembers(Visitor* visitor) {

// Mark loaded resources or resources without the buffer as loaded.
if (cached_resource_->IsLoaded() || !cached_resource_->ResourceBuffer()) {
if (!IsErrorStatusCode(cached_resource_->GetResponse().HttpStatusCode())) {
if (!IsHTTPErrorStatusCode(
cached_resource_->GetResponse().HttpStatusCode())) {
String content;
bool base64_encoded;
if (InspectorPageAgent::CachedResourceContent(cached_resource_, &content,
Expand Down

0 comments on commit 4624411

Please sign in to comment.