Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(470)

Unified Diff: components/plugins/renderer/webview_plugin.cc

Issue 2349443003: Listen to didReceiveResponse() to get the response in WebViewPlugin. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/plugins/renderer/webview_plugin.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/plugins/renderer/webview_plugin.cc
diff --git a/components/plugins/renderer/webview_plugin.cc b/components/plugins/renderer/webview_plugin.cc
index 81a26f43427684f980d4cb681c1315919cbe63f9..4bdc330a422ec4fd6ea1dc7e142f48ec49d7ae6b 100644
--- a/components/plugins/renderer/webview_plugin.cc
+++ b/components/plugins/renderer/webview_plugin.cc
@@ -95,9 +95,8 @@ WebViewPlugin::~WebViewPlugin() {
}
void WebViewPlugin::ReplayReceivedData(WebPlugin* plugin) {
- const WebURLResponse& response = web_frame_->dataSource()->response();
- if (!response.isNull()) {
- plugin->didReceiveResponse(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) {
@@ -124,6 +123,11 @@ void WebViewPlugin::ReplayReceivedData(WebPlugin* plugin) {
}
}
+void WebViewPlugin::didReceiveResponse(const WebURLResponse& response) {
+ if (!response_.isNull())
tommycli 2016/09/15 23:53:35 This line used to be DCHECK(response_.isNull());
tommycli 2016/09/16 00:01:38 Restoring the old DCHECK crashes, so I'm guessing
Bernhard Bauer 2016/09/16 10:28:01 Huh, that's strange. Where would the non-null valu
Nate Chapin 2016/09/16 17:17:54 Yeah this patchset only works accidentally: I inve
+ response_ = response;
+}
+
void WebViewPlugin::RestoreTitleText() {
if (container_)
container_->element().setAttribute("title", old_title_);
« no previous file with comments | « components/plugins/renderer/webview_plugin.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698