Open GoogleCodeExporter opened 9 years ago
You need to load at least one URL before you can use LoadRequest. For example,
you can pass "about:blank" as the |url| parameter to
CefBrowserHost::CreateBrowser. Once the browser has been created you can then
call LoadRequest(). See RequestSendRecvTestHandler in
tests/unittests/request_unittest.cc for an example.
Original comment by magreenb...@gmail.com
on 22 May 2012 at 3:43
Issue 727 has been merged into this issue.
Original comment by magreenb...@gmail.com
on 24 Sep 2012 at 3:40
There is currently no unit test for the LoadString case but it's likely the
same problem.
Original comment by magreenb...@gmail.com
on 24 Sep 2012 at 3:41
Issue 797 has been merged into this issue.
Original comment by magreenb...@gmail.com
on 26 Nov 2012 at 6:06
Issue 797 has been merged into this issue.
Original comment by magreenb...@gmail.com
on 16 Oct 2013 at 2:35
I experience this problem too.
Original comment by alervd...@gmail.com
on 20 Nov 2013 at 4:36
In CEF3 branch 1650 the following problem is reproducible :
1. Navigate to a page say google.com
2. Navigate to a non-existing address, ex:
http://insert-random-junk-chars-here.com
3. cefclient enters infinite loop where OnLoadError is called due to previous
frame->LoadString() in client_handler.cpp ClientHandler::OnLoadError
Original comment by nvine...@gmail.com
on 28 Jan 2014 at 12:58
Issue 1277 has been merged into this issue.
Original comment by magreenb...@gmail.com
on 20 May 2014 at 3:46
LoadRequest can be implemented from the browser process using
NavigationController::LoadURLWithParams. The LoadURLParams structure supports
extra headers, post data and target frame.
Original comment by magreenb...@gmail.com
on 20 May 2014 at 3:48
Issue 641 has been merged into this issue.
Original comment by magreenb...@gmail.com
on 20 May 2014 at 3:50
@comment#10: Also set should_clear_history_list via LoadRequest from the
browser process.
Original comment by magreenb...@gmail.com
on 20 May 2014 at 3:51
I have a patch for LoadString and LoadRequest to go through
NavigationController::LoadURLWithParams. I ran into a some problems supporting
all the existing options for LoadRequest:
1. No support for first_party_for_cookies
2. No support for load_flags
3. LoadURLWithParams expects a vector<char> for the body, so no support for
multi-part body
To support LoadString() I converted the string content into a data: url
Original comment by gber...@gmail.com
on 27 Jun 2014 at 4:03
Attachments:
@#12: Thanks for the patch.
> I ran into a some problems supporting all the existing options for
LoadRequest:
>
> 1. No support for first_party_for_cookies
> 2. No support for load_flags
> 3. LoadURLWithParams expects a vector<char> for the body, so no support for
multi-part body
These should be fine. |load_flags| is primarily intended for use with
CefURLRequest in any case.
> To support LoadString() I converted the string content into a data: url
This is a nice solution.
Some comments about your patch:
1. Please add a unit test for LoadString.
2.
https://code.google.com/p/chromiumembedded/issues/attachmentText?id=579&aid=5790
012000&name=cef_patch.txt&token=ABZ6GAdoKLA17EoEMbvKRfoYk1YW885PaQ%3A14038857607
61#488
+ IPC_MESSAGE_HANDLER(CefMsg_LoadRequest, LoadRequestParams)
A. Rename CefMsg_LoadRequest to CefHostMsg_LoadRequest because it is now sent
from the render process to the browser process.
B. Remove the CefMsg_LoadRequest handler from CefBrowserImpl because it's no
longer used.
C. Remove members from CefHostMsg_LoadRequest that are no longer supported.
3.
https://code.google.com/p/chromiumembedded/issues/attachmentText?id=579&aid=5790
012000&name=cef_patch.txt&token=ABZ6GAdoKLA17EoEMbvKRfoYk1YW885PaQ%3A14038857607
61#166
+ content::NavigationController::LoadURLParams params(
+ GetGURL(url));
Indent the 2nd+ lines 4 spaces instead of 2. Same with other locations.
4.
https://code.google.com/p/chromiumembedded/issues/attachmentText?id=579&aid=5790
012000&name=cef_patch.txt&token=ABZ6GAdoKLA17EoEMbvKRfoYk1YW885PaQ%3A14038857607
61#295
+};
} // namespace
Add a space between end of class and end of namespace.
Original comment by magreenb...@gmail.com
on 27 Jun 2014 at 4:39
@13: Thanks for the feedback. I'll work on your suggestions. Quick comment
on:
> 2B. Remove the CefMsg_LoadRequest handler from CefBrowserImpl because it's no
longer used.
This is still used for navigating from the render process in frame_impl.cc
Original comment by gber...@gmail.com
on 27 Jun 2014 at 4:56
@#14: But the message is no longer sent from the browser process to the render
process, right? So you don't need to handle the message in
CefBrowserImpl::OnMessageReceived.
Original comment by magreenb...@gmail.com
on 27 Jun 2014 at 4:58
@#15: Yup, I understand now. Thanks
Original comment by gber...@gmail.com
on 27 Jun 2014 at 5:01
@#12: I'm having some trouble writing up a unit test for LoadString.
1. None of the CefRequestHandler methods (OnBeforeResourceLoad,
GetResourceHandler, etc...) seem to be triggered by LoadString. So I can't
compare the CefRequest to the expected data url (similar to the SendRecv test
in request_test.cc)
2. I've tried using CefFrame::GetSource during OnLoadEnd, but the
CefStringVisitor::Visit method doesn't get triggered either. I'm not sure if
there is a timing issue causing this since the visitor is meant to be called
asynchronously. I can see the content getting loading the browser window so it
is there but perhaps not during OnLoadEnd.
Do you have any suggestions on now to implement a unit test for LoadString?
Original comment by gber...@gmail.com
on 30 Jun 2014 at 4:36
@#17: For 2, are you waiting for the VIsit method to be called asynchronously?
Original comment by magreenb...@gmail.com
on 30 Jun 2014 at 4:48
@#17: I'm not sure how to do that. As an aside, is there a way to run an
individual test without running through the entire test suite?
Thanks,
Original comment by gber...@gmail.com
on 30 Jun 2014 at 4:52
@#19:
> I'm not sure how to do that.
Create a TestHandler that also implements CefStringVisitor. Call
CefFrame::GetSource from inside OnLoadEnd using |this| as the visitor. Call
DestroyTest from the Visit implementation after verifying that the contents are
correct.
> As an aside, is there a way to run an individual test without running through
the entire test suite?
Pass --gtest_filter=TestType.TestName on the command-line.
Original comment by magreenb...@gmail.com
on 30 Jun 2014 at 4:58
@#20: Excellent... I got this working but my impl is a bit hacky. See attached.
I couldn't create a TestHandler that implements CefStringVisitor directly,
because CefFrame::GetSource takes in a CefRefPtr. So I can't pass in |this|
into GetSource.
Is there a CEF equivalent to boost::enable_shared_from_this I could use? Or do
you have any other idea on how to clean this up?
Original comment by gber...@gmail.com
on 30 Jun 2014 at 6:02
Attachments:
Here's the actual patch for the load string test
Original comment by gber...@gmail.com
on 30 Jun 2014 at 6:35
Attachments:
@#21: You should be able to assign |this| to a CefRefPtr, and then pass in the
CefRefPtr. For example: CefRefPtr<CefStringVisitor> visitor(this);
Original comment by magreenb...@gmail.com
on 30 Jun 2014 at 7:09
@#23: That works. Here's the updated patch for LoadString. Thanks again for the
feedback.
Original comment by gber...@gmail.com
on 30 Jun 2014 at 7:35
Attachments:
@#24: Looks good, thanks.
Original comment by magreenb...@gmail.com
on 30 Jun 2014 at 8:25
Any chance this can be patched into the 1916 branch?
Original comment by gber...@gmail.com
on 1 Jul 2014 at 8:46
Attachments:
@#26: Yes, it will be merged to 1916 as well.
Original comment by magreenb...@gmail.com
on 2 Jul 2014 at 9:46
Issue 763 has been merged into this issue.
Original comment by magreenb...@gmail.com
on 2 Jul 2014 at 10:25
Original comment by magreenb...@gmail.com
on 2 Jul 2014 at 10:26
Issue 1185 has been merged into this issue.
Original comment by magreenb...@gmail.com
on 2 Jul 2014 at 10:58
@#24: Added in trunk revision 1765 and 1916 branch revision 1766 with minor
changes.
Original comment by magreenb...@gmail.com
on 10 Jul 2014 at 6:24
@#31: The changes will be reverted due to the following problems (see also
issue #1339):
1. WebContentsImpl::NavigateToPendingEntry ignores the specified
frame_tree_node_id unless the "--site-per-process" flag is set. This mode is
still experimental and not fully implemented so we can't use it yet.
2. The frame_id value (which comes from RenderFrame routing ID) is not the same
as frame_tree_node_id. NavigationHelper will need to convert from frame_id to
frame_tree_node_id, perhaps using FrameTree::FindByRoutingID. Otherwise,
|frame_tree_.FindByID| in WebContentsImpl::NavigateToPendingEntry returns NULL.
3. Need to add unit tests for the sub-frame loading use case.
Original comment by magreenb...@gmail.com
on 16 Jul 2014 at 9:05
Issue 1339 has been merged into this issue.
Original comment by magreenb...@gmail.com
on 16 Jul 2014 at 9:06
@#32: Reverted in trunk revision 1780 and 1916 branch revision 1781.
Also:
4. When re-applying the changes to trunk remove the FilePathStringToWebString
function from browser_impl.cc since it is no longer used.
Original comment by magreenb...@gmail.com
on 16 Jul 2014 at 9:29
Trunk revision 2028 and 2272 branch revision 2029 update cefclient to use a
data: URI instead of LoadString for loading error messages. This also adds
base64 and URI encoding/decoding functions to cef_url.h.
Original comment by magreenb...@gmail.com
on 11 Feb 2015 at 6:17
CEF is transitioning from Google Code to Bitbucket project hosting. If you
would like to continue receiving notifications on this issue please add
yourself as a Watcher at the new location:
https://bitbucket.org/chromiumembedded/cef/issue/579
Original comment by magreenb...@gmail.com
on 14 Mar 2015 at 3:22
Original issue reported on code.google.com by
nesf...@gmail.com
on 24 Apr 2012 at 10:20