-
Notifications
You must be signed in to change notification settings - Fork 879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 2095: use the proper tab origin. #942
Conversation
Just a quick fix without tests since the issue is urgent. At the moment I'm continuing to make a reasonable test, but mocking site_for_cookies() is not obvious for me now. I'm also worried with the presence of a global lock for all requests with cookies, so probably we should create something more clever here. I can suggest at least one (not so clever) improvement:
|
Status update: SNAFU
|
b169f65
to
9c0f0f0
Compare
Pushed fix that seems working. Still no tests. |
auto* request_info = content::ResourceRequestInfo::ForRequest(request); | ||
if (request_info) { | ||
ctx->resource_type = request_info->GetResourceType(); | ||
} | ||
brave_shields::GetRenderFrameInfo(request, &ctx->render_process_id, &ctx->render_frame_id, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo - wrong order of render_process_id
and render_frame_id
c6d14c4
to
ab95843
Compare
@bbondy PTAL
|
@@ -107,9 +107,9 @@ void GetRenderFrameInfo(const URLRequest* request, | |||
if (request_info) { | |||
*frame_tree_node_id = request_info->GetFrameTreeNodeId(); | |||
} | |||
extensions::ExtensionApiFrameIdMap::FrameData frame_data; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dead code
BraveShieldsWebContentsObserver::render_frame_key_to_tab_url; | ||
BraveShieldsWebContentsObserver::frame_key_to_tab_url_; | ||
std::map<int, GURL> | ||
BraveShieldsWebContentsObserver::frame_tree_node_id_to_tab_url_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional map for tracking frame tree node ids. They are available on the IO thread for frames/subframes instead of the pair procces_id/frame_id
ab95843
to
6b1c4ee
Compare
12d4e3e
to
1152dfe
Compare
Rebased |
brave/brave-browser#2095 As per URLRequest documentation and the corresponding RFC, site_for_cookies cannot be used as a top-level document origin since it can be empty in certain cases. We need to replace it with something more reliable.
1152dfe
to
51e6a10
Compare
Issue 2095: use the proper tab origin.
Approving uplift to |
Issue 2095: use the proper tab origin.
0.57.x: 48cb280 |
Fix brave/brave-browser#2095
As per URLRequest documentation and the corresponding RFC,
site_for_cookies cannot be used as a top-level document origin since it
can be empty in certain cases. We need to replace it with something more
reliable.
Submitter Checklist:
npm test brave_unit_tests && npm test brave_browser_tests
) ongit rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist: