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

Unified Diff: chrome/renderer/chrome_render_process_observer.cc

Issue 1423713015: [WIP] WebRestrictions (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: chrome/renderer/chrome_render_process_observer.cc
diff --git a/chrome/renderer/chrome_render_process_observer.cc b/chrome/renderer/chrome_render_process_observer.cc
index f6455ff9ebdec8a69e3469bdc31f7e0970191721..384e0117f75141447d70d63ca56fd3e8bf259779 100644
--- a/chrome/renderer/chrome_render_process_observer.cc
+++ b/chrome/renderer/chrome_render_process_observer.cc
@@ -34,14 +34,14 @@
#include "components/variations/variations_util.h"
#include "content/public/child/resource_dispatcher_delegate.h"
#include "content/public/common/service_registry.h"
+#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_thread.h"
-#include "content/public/renderer/render_view.h"
-#include "content/public/renderer/render_view_visitor.h"
#include "net/base/net_errors.h"
#include "net/base/net_module.h"
#include "third_party/WebKit/public/web/WebCache.h"
#include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebFrame.h"
+#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebRuntimeFeatures.h"
#include "third_party/WebKit/public/web/WebSecurityPolicy.h"
#include "third_party/WebKit/public/web/WebView.h"
@@ -88,6 +88,16 @@ class RendererResourceDelegate : public content::ResourceDispatcherDelegate {
if (error_code == net::ERR_ABORTED) {
return NULL;
}
+ if (resource_type == content::RESOURCE_TYPE_MAIN_FRAME) {
+ blink::WebFrame* web_frame =
+ blink::WebLocalFrame::frameForCurrentContext();
+ content::RenderFrame* render_frame = nullptr;
+ if (web_frame != nullptr)
+ render_frame = content::RenderFrame::FromWebFrame(web_frame);
+ DLOG(WARNING) << "Got frames " << (web_frame != nullptr) << " & "
+ << (render_frame != nullptr);
+ // Investigate
+ }
// Resource canceled with a specific error are filtered.
return SecurityFilterPeer::CreateSecurityFilterPeerForDeniedRequest(

Powered by Google App Engine
This is Rietveld 408576698