Commit b913407c authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

[bfcache] use base::StringPiece instead of std::string_view

This broke the build with MSSTL and libstdc++ (introduced in crrev.com/c/1786449)

Bug: 957519
Change-Id: If4fdb2c4e08202d5a36870292138978ac68a5a4a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1817205
Commit-Queue: Avi Drissman <avi@chromium.org>
Commit-Queue: Varun Khaneja <vakh@chromium.org>
Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Auto-Submit: Jeremy Apthorp <jeremya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#698998}
parent 28818c92
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
#include <stddef.h> #include <stddef.h>
#include <stdint.h> #include <stdint.h>
#include <string_view>
#include <unordered_set> #include <unordered_set>
#include <utility> #include <utility>
#include <vector> #include <vector>
...@@ -18,6 +17,7 @@ ...@@ -18,6 +17,7 @@
#include "base/lazy_instance.h" #include "base/lazy_instance.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "components/history/core/browser/history_service.h" #include "components/history/core/browser/history_service.h"
...@@ -312,7 +312,7 @@ void TrimElements(const std::set<int> target_ids, ...@@ -312,7 +312,7 @@ void TrimElements(const std::set<int> target_ids,
} }
void DisableBackForwardCache(content::RenderFrameHost* rfh, void DisableBackForwardCache(content::RenderFrameHost* rfh,
std::string_view reason) { base::StringPiece reason) {
content::WebContents::FromRenderFrameHost(rfh) content::WebContents::FromRenderFrameHost(rfh)
->GetController() ->GetController()
.GetBackForwardCache() .GetBackForwardCache()
......
...@@ -360,7 +360,7 @@ void BackForwardCacheImpl::PostTaskToDestroyEvictedFrames() { ...@@ -360,7 +360,7 @@ void BackForwardCacheImpl::PostTaskToDestroyEvictedFrames() {
} }
void BackForwardCacheImpl::DisableForRenderFrameHost(GlobalFrameRoutingId id, void BackForwardCacheImpl::DisableForRenderFrameHost(GlobalFrameRoutingId id,
std::string_view reason) { base::StringPiece reason) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto* rfh = RenderFrameHostImpl::FromID(id); auto* rfh = RenderFrameHostImpl::FromID(id);
if (rfh) if (rfh)
......
...@@ -125,7 +125,7 @@ class CONTENT_EXPORT BackForwardCacheImpl : public BackForwardCache { ...@@ -125,7 +125,7 @@ class CONTENT_EXPORT BackForwardCacheImpl : public BackForwardCache {
// BackForwardCache: // BackForwardCache:
void DisableForRenderFrameHost(GlobalFrameRoutingId id, void DisableForRenderFrameHost(GlobalFrameRoutingId id,
std::string_view reason) override; base::StringPiece reason) override;
void DisableForTesting(DisableForTestingReason reason) override; void DisableForTesting(DisableForTestingReason reason) override;
private: private:
......
...@@ -5,8 +5,7 @@ ...@@ -5,8 +5,7 @@
#ifndef CONTENT_PUBLIC_BROWSER_BACK_FORWARD_CACHE_H_ #ifndef CONTENT_PUBLIC_BROWSER_BACK_FORWARD_CACHE_H_
#define CONTENT_PUBLIC_BROWSER_BACK_FORWARD_CACHE_H_ #define CONTENT_PUBLIC_BROWSER_BACK_FORWARD_CACHE_H_
#include <string_view> #include "base/strings/string_piece.h"
#include "content/common/content_export.h" #include "content/common/content_export.h"
#include "content/public/browser/global_routing_id.h" #include "content/public/browser/global_routing_id.h"
...@@ -43,7 +42,7 @@ class CONTENT_EXPORT BackForwardCache { ...@@ -43,7 +42,7 @@ class CONTENT_EXPORT BackForwardCache {
// |id|: If no RenderFrameHost can be found for the given id nothing happens. // |id|: If no RenderFrameHost can be found for the given id nothing happens.
// |reason|: Free form string to be used in logging and metrics. // |reason|: Free form string to be used in logging and metrics.
virtual void DisableForRenderFrameHost(GlobalFrameRoutingId id, virtual void DisableForRenderFrameHost(GlobalFrameRoutingId id,
std::string_view reason) = 0; base::StringPiece reason) = 0;
// List of reasons the BackForwardCache was disabled for a specific test. If a // List of reasons the BackForwardCache was disabled for a specific test. If a
// test needs to be disabled for a reason not covered below, please add to // test needs to be disabled for a reason not covered below, please add to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment