| Index: webkit/glue/plugins/webview_plugin.cc
|
| diff --git a/webkit/glue/plugins/webview_plugin.cc b/webkit/glue/plugins/webview_plugin.cc
|
| index d01c8529813df7fc7e0d654a7ad43c6a5b7d0e22..231bd37f6829ca9716adecc539fdf16923926d88 100644
|
| --- a/webkit/glue/plugins/webview_plugin.cc
|
| +++ b/webkit/glue/plugins/webview_plugin.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "webkit/glue/plugins/webview_plugin.h"
|
|
|
| +#include "base/histogram.h"
|
| #include "base/message_loop.h"
|
| #include "third_party/WebKit/WebKit/chromium/public/WebCursorInfo.h"
|
| #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h"
|
| @@ -52,9 +53,16 @@ WebViewPlugin::~WebViewPlugin() {
|
| }
|
|
|
| void WebViewPlugin::ReplayReceivedData(WebPlugin* plugin) {
|
| - if (response_.get()) {
|
| - plugin->didReceiveResponse(*response_);
|
| - plugin->didReceiveData(data_.c_str(), data_.length());
|
| + 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(), it->length());
|
| + total_bytes += it->length();
|
| + }
|
| + UMA_HISTOGRAM_MEMORY_KB("PluginDocument.Memory", (total_bytes / 1024));
|
| + UMA_HISTOGRAM_COUNTS("PluginDocument.NumChunks", data_.size());
|
| }
|
| if (finished_loading_) {
|
| plugin->didFinishLoading();
|
| @@ -123,12 +131,12 @@ bool WebViewPlugin::handleInputEvent(const WebInputEvent& event,
|
| }
|
|
|
| void WebViewPlugin::didReceiveResponse(const WebURLResponse& response) {
|
| - DCHECK(!response_.get());
|
| - response_.reset(new WebURLResponse(response));
|
| + DCHECK(response_.isNull());
|
| + response_ = response;
|
| }
|
|
|
| void WebViewPlugin::didReceiveData(const char* data, int data_length) {
|
| - data_.append(data, data_length);
|
| + data_.push_back(std::string(data, data_length));
|
| }
|
|
|
| void WebViewPlugin::didFinishLoading() {
|
|
|