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

Issue 2101323002: Add 'NavigationHandle::QueueConsoleMessage'. (Closed)

Created:
4 years, 5 months ago by Mike West
Modified:
3 years, 5 months ago
Reviewers:
clamy, nasko
CC:
chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, jam, msramek, nasko+codewatch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add 'NavigationHandle::QueueConsoleMessage'. NavigationThrottles like AncestorThrottle[1] and ClearSiteDataThrottle[2] need to dump messages to the console in order to inform developers of the success or failure of the web-facing features they implement. Rather than forcing each to come up with a message queuing system, we can abstract that into a simple mechanism hanging off of 'NavigationHandle' itself. This patch adds that mechanism, but only uses it in tests; real usage won't land until the aforementioned throttles land. [1]: https://codereview.chromium.org/1617043002/ [2]: https://codereview.chromium.org/2025683003 BUG=555418, 607897 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation

Patch Set 1 #

Patch Set 2 : extensions_unittests #

Total comments: 4

Patch Set 3 : -public #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+122 lines, -0 lines) Patch
M content/browser/frame_host/navigation_handle_impl.h View 1 2 4 chunks +17 lines, -0 lines 3 comments Download
M content/browser/frame_host/navigation_handle_impl.cc View 1 2 3 chunks +26 lines, -0 lines 0 comments Download
M content/browser/frame_host/navigation_handle_impl_unittest.cc View 1 2 4 chunks +64 lines, -0 lines 0 comments Download
M content/test/test_render_frame_host.h View 3 chunks +9 lines, -0 lines 0 comments Download
M content/test/test_render_frame_host.cc View 1 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (2 generated)
Mike West
nasko@, clamy@: Based on the discussion in https://codereview.chromium.org/2097083002#msg10, this seems like it might be a ...
4 years, 5 months ago (2016-06-28 10:03:11 UTC) #3
clamy
Thanks! https://codereview.chromium.org/2101323002/diff/20001/content/browser/frame_host/navigation_handle_impl.cc File content/browser/frame_host/navigation_handle_impl.cc (right): https://codereview.chromium.org/2101323002/diff/20001/content/browser/frame_host/navigation_handle_impl.cc#newcode406 content/browser/frame_host/navigation_handle_impl.cc:406: DumpMessagesToConsole(); This is problematic right now for transfer ...
4 years, 5 months ago (2016-06-28 11:30:38 UTC) #4
Mike West
https://codereview.chromium.org/2101323002/diff/20001/content/browser/frame_host/navigation_handle_impl.cc File content/browser/frame_host/navigation_handle_impl.cc (right): https://codereview.chromium.org/2101323002/diff/20001/content/browser/frame_host/navigation_handle_impl.cc#newcode406 content/browser/frame_host/navigation_handle_impl.cc:406: DumpMessagesToConsole(); On 2016/06/28 at 11:30:38, clamy wrote: > This ...
4 years, 5 months ago (2016-06-28 12:22:33 UTC) #5
nasko
https://codereview.chromium.org/2101323002/diff/40001/content/browser/frame_host/navigation_handle_impl.h File content/browser/frame_host/navigation_handle_impl.h (right): https://codereview.chromium.org/2101323002/diff/40001/content/browser/frame_host/navigation_handle_impl.h#newcode241 content/browser/frame_host/navigation_handle_impl.h:241: void QueueConsoleMessage(ConsoleMessageLevel level, bikeshed: AppendConsoleMessage? Queue to me implies ...
4 years, 5 months ago (2016-06-28 22:25:46 UTC) #6
Mike West
On 2016/06/28 at 22:25:46, nasko wrote: > https://codereview.chromium.org/2101323002/diff/40001/content/browser/frame_host/navigation_handle_impl.h > File content/browser/frame_host/navigation_handle_impl.h (right): > > https://codereview.chromium.org/2101323002/diff/40001/content/browser/frame_host/navigation_handle_impl.h#newcode241 ...
4 years, 5 months ago (2016-06-29 05:37:02 UTC) #7
clamy
4 years, 5 months ago (2016-06-29 11:07:29 UTC) #8
Thanks! A few more questions.

https://codereview.chromium.org/2101323002/diff/40001/content/browser/frame_h...
File content/browser/frame_host/navigation_handle_impl.h (right):

https://codereview.chromium.org/2101323002/diff/40001/content/browser/frame_h...
content/browser/frame_host/navigation_handle_impl.h:240: // committed will be
delivered immediately.
The navigation commit corresponds to the destruction of this NavigationHandle,
so this comment seems a bit misleading to me. How about "at commit time" instead
of "after the navigation has committed".

There's also the question of what happens if the navigation doesn't commit.
Should we just drop them? Deliver them to the current RenderFrameHost of the
FrameTreeNode (maybe only if it was renderer initiated)? Once we come to an
agreement, this should be precised in the comment.

https://codereview.chromium.org/2101323002/diff/40001/content/browser/frame_h...
content/browser/frame_host/navigation_handle_impl.h:282: virtual void
DumpMessagesToConsole();
Why virtual?

Powered by Google App Engine
This is Rietveld 408576698