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

Unified Diff: content/renderer/pepper/renderer_ppapi_host_impl.cc

Issue 1004803007: Pepper: Cache the document URL in PepperPluginInstanceImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 5 years, 9 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 | « content/renderer/pepper/renderer_ppapi_host_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/renderer_ppapi_host_impl.cc
diff --git a/content/renderer/pepper/renderer_ppapi_host_impl.cc b/content/renderer/pepper/renderer_ppapi_host_impl.cc
index 62faf51e12df571aa5221ccb536826dba6efc4af..61c1ba66f007de890ecff41200df058dc0555d5f 100644
--- a/content/renderer/pepper/renderer_ppapi_host_impl.cc
+++ b/content/renderer/pepper/renderer_ppapi_host_impl.cc
@@ -258,20 +258,11 @@ void RendererPpapiHostImpl::CreateBrowserResourceHosts(
}
}
-GURL RendererPpapiHostImpl::GetDocumentURL(PP_Instance instance) const {
- blink::WebPluginContainer* container = GetContainerForInstance(instance);
- if (!container)
- return GURL();
-
- blink::WebElement element = container->element();
- if (element.isNull())
- return GURL();
-
- blink::WebDocument document = element.document();
- if (document.isNull())
+GURL RendererPpapiHostImpl::GetDocumentURL(PP_Instance pp_instance) const {
+ PepperPluginInstanceImpl* instance = GetAndValidateInstance(pp_instance);
+ if (!instance)
return GURL();
-
- return document.url();
+ return instance->document_url();
}
PepperPluginInstanceImpl* RendererPpapiHostImpl::GetAndValidateInstance(
« no previous file with comments | « content/renderer/pepper/renderer_ppapi_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698