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

Unified Diff: content/renderer/npapi/webplugin_impl.cc

Issue 1426923007: Remove PluginLoadObserver and related logic, it was only used for NPAPI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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
Index: content/renderer/npapi/webplugin_impl.cc
diff --git a/content/renderer/npapi/webplugin_impl.cc b/content/renderer/npapi/webplugin_impl.cc
index ac739b5bc974523564a2ec6ba1dec844a03e7e65..fe30ce86cc5e80735e74b784269cfb0824cdd41d 100644
--- a/content/renderer/npapi/webplugin_impl.cc
+++ b/content/renderer/npapi/webplugin_impl.cc
@@ -463,31 +463,6 @@ void WebPluginImpl::didFailLoading(const WebURLError& error) {
delegate_->DidManualLoadFail();
}
-void WebPluginImpl::didFinishLoadingFrameRequest(
- const WebURL& url, void* notify_data) {
- if (delegate_) {
- // We're converting a void* into an arbitrary int id. Though
- // these types are the same size on all the platforms we support,
- // the compiler may complain as though they are different, so to
- // make the casting gods happy go through an intptr_t (the union
- // of void* and int) rather than converting straight across.
- delegate_->DidFinishLoadWithReason(
- url, NPRES_DONE, reinterpret_cast<intptr_t>(notify_data));
- }
-}
-
-void WebPluginImpl::didFailLoadingFrameRequest(
- const WebURL& url, void* notify_data, const WebURLError& error) {
- if (!delegate_)
- return;
-
- NPReason reason =
- error.reason == net::ERR_ABORTED ? NPRES_USER_BREAK : NPRES_NETWORK_ERR;
- // See comment in didFinishLoadingFrameRequest about the cast here.
- delegate_->DidFinishLoadWithReason(
- url, reason, reinterpret_cast<intptr_t>(notify_data));
-}
-
bool WebPluginImpl::isPlaceholder() {
return false;
}
@@ -697,7 +672,6 @@ WebPluginImpl::RoutingStatus WebPluginImpl::RouteToFrame(
const char* target,
const char* buf,
unsigned int len,
- int notify_id,
ReferrerValue referrer_flag) {
// If there is no target, there is nothing to do
if (!target)
@@ -761,8 +735,7 @@ WebPluginImpl::RoutingStatus WebPluginImpl::RouteToFrame(
}
}
- container_->loadFrameRequest(
- request, target_str, notify_id != 0, reinterpret_cast<void*>(notify_id));
+ container_->loadFrameRequest(request, target_str);
return ROUTED;
}
@@ -902,7 +875,7 @@ void WebPluginImpl::InvalidateRect(const gfx::Rect& rect) {
void WebPluginImpl::OnDownloadPluginSrcUrl() {
HandleURLRequestInternal(
- plugin_url_.spec().c_str(), "GET", NULL, NULL, 0, 0, false, DOCUMENT_URL,
+ plugin_url_.spec().c_str(), "GET", NULL, NULL, 0, false, DOCUMENT_URL,
false, true);
}
@@ -1038,7 +1011,7 @@ void WebPluginImpl::didReceiveResponse(WebURLLoader* loader,
for (size_t i = 0; i < clients_.size(); ++i) {
if (clients_[i].loader.get() == loader) {
WebPluginResourceClient* resource_client =
- delegate_->CreateResourceClient(clients_[i].id, plugin_url_, 0);
+ delegate_->CreateResourceClient(clients_[i].id, plugin_url_);
clients_[i].client = resource_client;
client = resource_client;
break;
@@ -1163,13 +1136,12 @@ void WebPluginImpl::HandleURLRequest(const char* url,
const char* target,
const char* buf,
unsigned int len,
- int notify_id,
bool popups_allowed,
bool notify_redirects) {
// GetURL/PostURL requests initiated explicitly by plugins should specify the
// plugin SRC url as the referrer if it is available.
HandleURLRequestInternal(
- url, method, target, buf, len, notify_id, popups_allowed, PLUGIN_SRC,
+ url, method, target, buf, len, popups_allowed, PLUGIN_SRC,
notify_redirects, false);
}
@@ -1178,7 +1150,6 @@ void WebPluginImpl::HandleURLRequestInternal(const char* url,
const char* target,
const char* buf,
unsigned int len,
- int notify_id,
bool popups_allowed,
ReferrerValue referrer_flag,
bool notify_redirects,
@@ -1194,7 +1165,7 @@ void WebPluginImpl::HandleURLRequestInternal(const char* url,
url::FindAndCompareScheme(url, strlen(url), url::kJavaScriptScheme, NULL);
RoutingStatus routing_status = RouteToFrame(
url, is_javascript_url, popups_allowed, method, target, buf, len,
- notify_id, referrer_flag);
+ referrer_flag);
if (routing_status == ROUTED)
return;
@@ -1205,8 +1176,7 @@ void WebPluginImpl::HandleURLRequestInternal(const char* url,
// delegate_ could be NULL because executeScript caused the container to
// be deleted.
if (delegate_) {
- delegate_->SendJavaScriptStream(
- gurl, result.utf8(), !result.isNull(), notify_id);
+ delegate_->SendJavaScriptStream(gurl, result.utf8(), !result.isNull());
}
return;
@@ -1226,7 +1196,7 @@ void WebPluginImpl::HandleURLRequestInternal(const char* url,
if ((routing_status == INVALID_URL) ||
(routing_status == GENERAL_FAILURE)) {
WebPluginResourceClient* resource_client = delegate_->CreateResourceClient(
- resource_id, complete_url, notify_id);
+ resource_id, complete_url);
if (resource_client)
resource_client->DidFail(resource_id);
return;
@@ -1257,14 +1227,14 @@ void WebPluginImpl::HandleURLRequestInternal(const char* url,
request.referrerPolicy());
GURL first_party_for_cookies = webframe_->document().firstPartyForCookies();
- delegate_->FetchURL(resource_id, notify_id, complete_url,
+ delegate_->FetchURL(resource_id, complete_url,
first_party_for_cookies, method, buf, len, referrer,
notify_redirects, is_plugin_src_load, 0,
render_frame_->GetRoutingID(),
render_view_->GetRoutingID());
} else {
WebPluginResourceClient* resource_client = delegate_->CreateResourceClient(
- resource_id, complete_url, notify_id);
+ resource_id, complete_url);
if (!resource_client)
return;
InitiateHTTPRequest(resource_id, resource_client, complete_url, method, buf,

Powered by Google App Engine
This is Rietveld 408576698