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

Unified Diff: content/renderer/renderer_webapplicationcachehost_impl.cc

Issue 2601763002: WebFrame cleanup: Move addMessageToConsole to WebLocalFrame (Closed)
Patch Set: Created 4 years 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/renderer_webapplicationcachehost_impl.cc
diff --git a/content/renderer/renderer_webapplicationcachehost_impl.cc b/content/renderer/renderer_webapplicationcachehost_impl.cc
index 7ac1620e9d7ee184441fc0608c996ad227e98953..7208291f1cf460113d852d860de886177625cb27 100644
--- a/content/renderer/renderer_webapplicationcachehost_impl.cc
+++ b/content/renderer/renderer_webapplicationcachehost_impl.cc
@@ -8,6 +8,7 @@
#include "content/renderer/render_thread_impl.h"
#include "content/renderer/render_view_impl.h"
#include "third_party/WebKit/public/web/WebFrame.h"
+#include "third_party/WebKit/public/web/WebLocalFrame.h"
#include "third_party/WebKit/public/web/WebView.h"
using blink::WebApplicationCacheHostClient;
@@ -34,9 +35,13 @@ void RendererWebApplicationCacheHostImpl::OnLogMessage(
return;
blink::WebFrame* frame = render_view->webview()->mainFrame();
- frame->addMessageToConsole(WebConsoleMessage(
- static_cast<WebConsoleMessage::Level>(log_level),
- blink::WebString::fromUTF8(message.c_str())));
+ if (!frame->isWebLocalFrame())
+ return;
+ // TODO(michaeln): Make app cache host per-frame and correctly report to the
dcheng 2016/12/27 08:48:59 +michaeln, +ananta since I know there's some appca
+ // involved frame.
+ frame->toWebLocalFrame()->addMessageToConsole(
+ WebConsoleMessage(static_cast<WebConsoleMessage::Level>(log_level),
+ blink::WebString::fromUTF8(message.c_str())));
}
void RendererWebApplicationCacheHostImpl::OnContentBlocked(

Powered by Google App Engine
This is Rietveld 408576698