forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This CL refactors out AlwaysAccessNetwork function and puts it to Blink's public API. Bug: 860403 Change-Id: I42a600fd822ef8488b78ac0b16860da40896ba9a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2281544 Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Commit-Queue: Minggang Wang <minggang.wang@intel.com> Cr-Commit-Position: refs/heads/master@{#786735}
- Loading branch information
Minggang Wang
authored and
Commit Bot
committed
Jul 9, 2020
1 parent
b61e162
commit 187e663
Showing
6 changed files
with
48 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2020 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "third_party/blink/public/common/loader/network_utils.h" | ||
|
||
namespace blink { | ||
|
||
bool AlwaysAccessNetwork( | ||
const scoped_refptr<net::HttpResponseHeaders>& headers) { | ||
if (!headers) | ||
return false; | ||
|
||
// RFC 2616, section 14.9. | ||
return headers->HasHeaderValue("cache-control", "no-cache") || | ||
headers->HasHeaderValue("cache-control", "no-store") || | ||
headers->HasHeaderValue("pragma", "no-cache") || | ||
headers->HasHeaderValue("vary", "*"); | ||
} | ||
|
||
} // namespace blink |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright 2020 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_LOADER_NETWORK_UTILS_H_ | ||
#define THIRD_PARTY_BLINK_PUBLIC_COMMON_LOADER_NETWORK_UTILS_H_ | ||
|
||
#include "base/memory/scoped_refptr.h" | ||
#include "net/http/http_response_headers.h" | ||
#include "third_party/blink/public/common/common_export.h" | ||
|
||
namespace blink { | ||
|
||
// Returns true if the headers indicate that this resource should always be | ||
// revalidated or not cached. | ||
BLINK_COMMON_EXPORT bool AlwaysAccessNetwork( | ||
const scoped_refptr<net::HttpResponseHeaders>& headers); | ||
|
||
} // namespace blink | ||
|
||
#endif // THIRD_PARTY_BLINK_PUBLIC_COMMON_LOADER_NETWORK_UTILS_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters