Commit 4db9f1d3 authored by Findit's avatar Findit

Revert "[Feed v2] Allow setting feed stream data in feed internals page"

This reverts commit 325dbbc8.

Reason for revert:

Findit (https://goo.gl/kROfz5) identified CL at revision 814073 as the
culprit for failures in the build cycles as shown on:
https://analysis.chromium.org/waterfall/culprit?key=ag9zfmZpbmRpdC1mb3ItbWVyRAsSDVdmU3VzcGVjdGVkQ0wiMWNocm9taXVtLzMyNWRiYmM4NTkwM2M5NjUwMDFmNmI2NmI0MWE3YzNhMGE5NmU0OGUM

Sample Failed Build: https://ci.chromium.org/b/8867218581185660560

Sample Failed Step: compile

Original change's description:
> [Feed v2] Allow setting feed stream data in feed internals page
> 
> Bug: none
> Change-Id: Iecc0cb44e239c1b4502e81bc50931230732af61a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2429930
> Commit-Queue: Jian Li <jianli@chromium.org>
> Reviewed-by: Justin DeWitt <dewittj@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Reviewed-by: Dan H <harringtond@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#814073}


Change-Id: Iddd3027f84e54727f4f0dc5f905a5e1e330b16d1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: none
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2450611
Cr-Commit-Position: refs/heads/master@{#814088}
parent 1e2dc1f6
......@@ -175,9 +175,5 @@ found in the LICENSE file.
<input id="actions-endpoint-override">
<button id="actions-endpoint-override-apply">Apply</button>
<h2>Feed Stream Data (v2 only)</h2>
<input id="feed-stream-data-file" type="file">
<button id="feed-stream-data-override">Override</button>
</body>
</html>
......@@ -154,18 +154,6 @@ function setupEventListeners() {
$('actions-endpoint-override-apply').addEventListener('click', function() {
pageHandler.overrideFeedHost({url: $('actions-endpoint-override').value});
});
$('feed-stream-data-override').addEventListener('click', function() {
const file = $('feed-stream-data-file').files[0];
if (file && typeof pageHandler.overrideFeedStreamData == 'function') {
const reader = new FileReader();
reader.readAsArrayBuffer(file);
reader.onload = function(evt) {
const typedArray = new Uint8Array(reader.result);
pageHandler.overrideFeedStreamData([...typedArray]);
};
}
});
}
function updatePage() {
......
......@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/android/channel.gni")
import("//mojo/public/tools/bindings/mojom.gni")
mojom("mojo_bindings") {
......
......@@ -128,7 +128,4 @@ interface PageHandler {
// This allows for testing the Feed against a development server.
OverrideActionUploadEndpoint(url.mojom.Url endpoint_url);
// Overrides the feed stream data with an encoded ElementsOutput proto message
// for testing purpose.
OverrideFeedStreamData(array<uint8> data);
};
......@@ -182,8 +182,3 @@ void FeedInternalsPageHandler::OverrideActionUploadEndpoint(
const GURL& endpoint_url) {
// Not implemented for Feed v1.
}
void FeedInternalsPageHandler::OverrideFeedStreamData(
const std::vector<uint8_t>& data) {
// Not implemented for Feed v1.
}
......@@ -47,7 +47,6 @@ class FeedInternalsPageHandler : public feed_internals::mojom::PageHandler {
void GetFeedHistograms(GetFeedHistogramsCallback) override;
void OverrideFeedHost(const GURL& host) override;
void OverrideActionUploadEndpoint(const GURL& endpoint_url) override;
void OverrideFeedStreamData(const std::vector<uint8_t>& data) override;
private:
mojo::Receiver<feed_internals::mojom::PageHandler> receiver_;
......
......@@ -12,7 +12,6 @@
#include "chrome/browser/ui/webui/feed_internals/feed_internals.mojom.h"
#include "components/feed/core/common/pref_names.h"
#include "components/feed/core/common/user_classifier.h"
#include "components/feed/core/proto/v2/ui.pb.h"
#include "components/feed/core/shared_prefs/pref_names.h"
#include "components/feed/core/v2/public/feed_service.h"
#include "components/feed/core/v2/public/feed_stream_api.h"
......@@ -149,12 +148,3 @@ void FeedV2InternalsPageHandler::OverrideActionUploadEndpoint(
feed::prefs::kActionsEndpointOverride,
endpoint_url.is_valid() ? endpoint_url.spec() : std::string());
}
void FeedV2InternalsPageHandler::OverrideFeedStreamData(
const std::vector<uint8_t>& data) {
feedui::StreamUpdate stream_update;
feedui::Slice* slice = stream_update.add_updated_slices()->mutable_slice();
slice->set_slice_id("SetByInternalsPage");
slice->mutable_xsurface_slice()->set_xsurface_frame(data.data(), data.size());
feed_stream_->SetForcedStreamUpdateForDebugging(stream_update);
}
......@@ -46,7 +46,6 @@ class FeedV2InternalsPageHandler : public feed_internals::mojom::PageHandler {
void GetFeedHistograms(GetFeedHistogramsCallback) override;
void OverrideFeedHost(const GURL& host) override;
void OverrideActionUploadEndpoint(const GURL& endpoint_url) override;
void OverrideFeedStreamData(const std::vector<uint8_t>& data) override;
private:
bool IsFeedAllowed();
......
......@@ -239,17 +239,8 @@ void FeedStream::UpdateIsActivityLoggingEnabled() {
void FeedStream::AttachSurface(SurfaceInterface* surface) {
metrics_reporter_->SurfaceOpened(surface->GetSurfaceId());
// Skip normal processing when overriding stream data from the internals page.
if (forced_stream_update_for_debugging_.updated_slices_size() > 0) {
surface_updater_->SurfaceAdded(surface);
surface->StreamUpdate(forced_stream_update_for_debugging_);
return;
}
TriggerStreamLoad();
surface_updater_->SurfaceAdded(surface);
// Cancel any scheduled model unload task.
++unload_on_detach_sequence_number_;
}
......@@ -454,11 +445,6 @@ std::string FeedStream::DumpStateForDebugging() {
return ss.str();
}
void FeedStream::SetForcedStreamUpdateForDebugging(
const feedui::StreamUpdate& stream_update) {
forced_stream_update_for_debugging_ = stream_update;
}
base::Time FeedStream::GetLastFetchTime() {
const base::Time fetch_time =
profile_prefs_->GetTime(feed::prefs::kLastFetchAttemptTime);
......
......@@ -16,7 +16,6 @@
#include "base/version.h"
#include "components/feed/core/common/enums.h"
#include "components/feed/core/common/user_classifier.h"
#include "components/feed/core/proto/v2/ui.pb.h"
#include "components/feed/core/proto/v2/wire/response.pb.h"
#include "components/feed/core/v2/enums.h"
#include "components/feed/core/v2/protocol_translator.h"
......@@ -149,8 +148,6 @@ class FeedStream : public FeedStreamApi,
DebugStreamData GetDebugStreamData() override;
void ForceRefreshForDebugging() override;
std::string DumpStateForDebugging() override;
void SetForcedStreamUpdateForDebugging(
const feedui::StreamUpdate& stream_update) override;
void ReportSliceViewed(SurfaceId surface_id,
const std::string& slice_id) override;
......@@ -342,10 +339,6 @@ class FeedStream : public FeedStreamApi,
// To allow tests to wait on task queue idle.
base::RepeatingClosure idle_callback_;
// Stream update forced to use for new surfaces. This is provided in feed
// internals page for debugging purpose.
feedui::StreamUpdate forced_stream_update_for_debugging_;
base::WeakPtrFactory<FeedStream> weak_ptr_factory_{this};
};
......
......@@ -170,9 +170,6 @@ class FeedStreamApi {
virtual void ForceRefreshForDebugging() = 0;
// Dumps some state information for debugging.
virtual std::string DumpStateForDebugging() = 0;
// Forces to render a StreamUpdate on all subsequent surface attaches.
virtual void SetForcedStreamUpdateForDebugging(
const feedui::StreamUpdate& stream_update) = 0;
};
} // namespace feed
......
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