Commit 8ed4bf69 authored by japhet's avatar japhet Committed by Commit bot

Listen to didReceiveResponse() to get the response in WebViewPlugin.

This is a partial revert of the WebViewPlugin changes in
https://crrev.com/8489f1bf78c2c6f296e0df6c529751d29e8a0188

BUG=641028

Review-Url: https://codereview.chromium.org/2349443003
Cr-Commit-Position: refs/heads/master@{#419387}
parent 4887d11c
......@@ -95,23 +95,6 @@ WebViewPlugin::~WebViewPlugin() {
}
void WebViewPlugin::ReplayReceivedData(WebPlugin* plugin) {
const WebURLResponse& response = web_frame_->dataSource()->response();
if (!response.isNull()) {
plugin->didReceiveResponse(response);
size_t total_bytes = 0;
for (std::list<std::string>::iterator it = data_.begin(); it != data_.end();
++it) {
plugin->didReceiveData(
it->c_str(), base::checked_cast<int, size_t>(it->length()));
total_bytes += it->length();
}
UMA_HISTOGRAM_MEMORY_KB(
"PluginDocument.Memory",
(base::checked_cast<int, size_t>(total_bytes / 1024)));
UMA_HISTOGRAM_COUNTS(
"PluginDocument.NumChunks",
(base::checked_cast<int, size_t>(data_.size())));
}
// We need to transfer the |focused_| to new plugin after it loaded.
if (focused_) {
plugin->updateFocus(true, blink::WebFocusTypeNone);
......
......@@ -108,6 +108,11 @@ class WebViewPlugin : public blink::WebPlugin,
const blink::WebInputEvent& event,
blink::WebCursorInfo& cursor_info) override;
// didReceiveResponse() overrides both WebPlugin and WebFrameClient.
// The WebFrameClient variant receives callbacks, but the WebPlugin variant
// shouldn't.
// TODO(japhet): WebViewPlugin shouldn't be a WebFrameClient, after which
// didReceiveResponse() should have a NOTREACHED().
void didReceiveResponse(const blink::WebURLResponse& response) override {}
void didReceiveData(const char* data, int data_length) override;
void didFinishLoading() override;
......
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