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

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2252153002: Add crash keys to capture useful data for origin mismatch crashes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Register crash keys. Created 4 years, 4 months 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 unified diff | Download patch
« no previous file with comments | « chrome/common/crash_keys.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_frame_impl.h" 5 #include "content/renderer/render_frame_impl.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 4753 matching lines...) Expand 10 before | Expand all | Expand 10 after
4764 4764
4765 // Standard URLs must match the reported origin, when it is not unique. 4765 // Standard URLs must match the reported origin, when it is not unique.
4766 // This check is very similar to RenderFrameHostImpl::CanCommitOrigin, but 4766 // This check is very similar to RenderFrameHostImpl::CanCommitOrigin, but
4767 // adapted to the renderer process side. 4767 // adapted to the renderer process side.
4768 if (!params.origin.unique() && params.url.IsStandard() && 4768 if (!params.origin.unique() && params.url.IsStandard() &&
4769 render_view_->GetWebkitPreferences().web_security_enabled) { 4769 render_view_->GetWebkitPreferences().web_security_enabled) {
4770 // Exclude file: URLs when settings allow them access any origin. 4770 // Exclude file: URLs when settings allow them access any origin.
4771 if (params.origin.scheme() != url::kFileScheme || 4771 if (params.origin.scheme() != url::kFileScheme ||
4772 !render_view_->GetWebkitPreferences() 4772 !render_view_->GetWebkitPreferences()
4773 .allow_universal_access_from_file_urls) { 4773 .allow_universal_access_from_file_urls) {
4774 base::debug::SetCrashKeyValue("origin_mismatch_url", params.url.spec());
4775 base::debug::SetCrashKeyValue("origin_mismatch_origin",
4776 params.origin.Serialize());
4777 base::debug::SetCrashKeyValue("origin_mismatch_transition",
4778 base::IntToString(params.transition));
4779 base::debug::SetCrashKeyValue("origin_mismatch_redirects",
4780 base::IntToString(params.redirects.size()));
4781 base::debug::SetCrashKeyValue(
4782 "origin_mismatch_same_page",
4783 base::IntToString(params.was_within_same_page));
4774 CHECK(params.origin.IsSameOriginWith(url::Origin(params.url))) 4784 CHECK(params.origin.IsSameOriginWith(url::Origin(params.url)))
4775 << " url:" << params.url << " origin:" << params.origin; 4785 << " url:" << params.url << " origin:" << params.origin;
4776 } 4786 }
4777 } 4787 }
4778 4788
4779 // This message needs to be sent before any of allowScripts(), 4789 // This message needs to be sent before any of allowScripts(),
4780 // allowImages(), allowPlugins() is called for the new page, so that when 4790 // allowImages(), allowPlugins() is called for the new page, so that when
4781 // these functions send a ViewHostMsg_ContentBlocked message, it arrives 4791 // these functions send a ViewHostMsg_ContentBlocked message, it arrives
4782 // after the FrameHostMsg_DidCommitProvisionalLoad message. 4792 // after the FrameHostMsg_DidCommitProvisionalLoad message.
4783 Send(new FrameHostMsg_DidCommitProvisionalLoad(routing_id_, params)); 4793 Send(new FrameHostMsg_DidCommitProvisionalLoad(routing_id_, params));
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after
6343 // event target. Potentially a Pepper plugin will receive the event. 6353 // event target. Potentially a Pepper plugin will receive the event.
6344 // In order to tell whether a plugin gets the last mouse event and which it 6354 // In order to tell whether a plugin gets the last mouse event and which it
6345 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6355 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6346 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6356 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6347 // |pepper_last_mouse_event_target_|. 6357 // |pepper_last_mouse_event_target_|.
6348 pepper_last_mouse_event_target_ = nullptr; 6358 pepper_last_mouse_event_target_ = nullptr;
6349 #endif 6359 #endif
6350 } 6360 }
6351 6361
6352 } // namespace content 6362 } // namespace content
OLDNEW
« no previous file with comments | « chrome/common/crash_keys.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698