diff options
author | scr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-02 04:18:33 +0000 |
---|---|---|
committer | scr@chromium.org <scr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-02 04:18:33 +0000 |
commit | 350019fded4b55fec4392bab8a97664cbd803c4c (patch) | |
tree | 746e4e9490a01dfb3b316f0266c1bd162873d6dc /chrome/common | |
parent | 5f7c4fedfa98229c863acbd8977747571c37cb7d (diff) | |
download | chromium_src-350019fded4b55fec4392bab8a97664cbd803c4c.zip chromium_src-350019fded4b55fec4392bab8a97664cbd803c4c.tar.gz chromium_src-350019fded4b55fec4392bab8a97664cbd803c4c.tar.bz2 |
Preload with RVH/RV messaging instead of NOTIFICATION_NAV_ENTRY_COMMITTED.
This patch is the first working version using a preload message in the style of
viewsource.
NOTIFICATION_NAV_ENTRY_COMMITTED was too late as it was after the navigate
command was sent and was a race condition to inject before the onload ran.
Basic gist of this patch is:
- Wait for RVH creation by listening for NOTIFICATION_RENDER_VIEW_HOST_CREATED.
Since this is called from constructor, we must listen to AllSources() and
assume the next RVH creation is ours. This is controlled test case, so we're
probably ok.
- When RenderViewHostInitialized, call the OnJsInjectionReady passing the
RVH. JsInjectionReadyObserver should now use that RVH to Send a
ViewMsg_WebUIJavascript message to register javascript to preload.
- the ChromeRenderViewObserver will stash the javascript and load it when
DidStartLoading.
BUG=90476
TEST=browser_tests --gtest_filter=PrintPreview*WebUI*.*
Review URL: http://codereview.chromium.org/7531029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@95048 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/render_messages.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h index f48b088..88b0f5d 100644 --- a/chrome/common/render_messages.h +++ b/chrome/common/render_messages.h @@ -145,6 +145,15 @@ IPC_MESSAGE_CONTROL0(ViewMsg_ClearCache) // JS garbage, not in purging irreplaceable objects. IPC_MESSAGE_CONTROL0(ViewMsg_PurgeMemory) +// For WebUI testing, this message stores parameters to do ScriptEvalRequest at +// a time which is late enough to not be thrown out, and early enough to be +// before onload events are fired. +IPC_MESSAGE_ROUTED4(ViewMsg_WebUIJavaScript, + string16, /* frame_xpath */ + string16, /* jscript_url */ + int, /* ID */ + bool /* If true, result is sent back. */) + // Tells the render view to capture a thumbnail image of the page. The // render view responds with a ViewHostMsg_Snapshot. IPC_MESSAGE_ROUTED0(ViewMsg_CaptureSnapshot) |