summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Mineer <amineer@chromium.org>2016-03-18 14:36:17 -0700
committerAlex Mineer <amineer@chromium.org>2016-03-18 21:38:22 +0000
commit0e090776996c4942b886b8a2096d1295cab6279e (patch)
tree364b93d128299d7274ae2e86fc2e255f4269ef37
parentc25b3f9fd96e6cb7fa82e6e0e1756077055b5564 (diff)
downloadchromium_src-0e090776996c4942b886b8a2096d1295cab6279e.zip
chromium_src-0e090776996c4942b886b8a2096d1295cab6279e.tar.gz
chromium_src-0e090776996c4942b886b8a2096d1295cab6279e.tar.bz2
Add null check of the return value of Document::frame() in DTL::reportResponseReceived()
BUG=578849 Review URL: https://codereview.chromium.org/1603783002 (cherry picked from commit d2535dca624b5531247dbcbc2048dded6e9c45fc) Cr-Original-Commit-Position: refs/heads/master@{#370674} Cr-Commit-Position: refs/branch-heads/2623@{#639} Cr-Branched-From: 92d77538a86529ca35f9220bd3cd512cbea1f086-refs/heads/master@{#369907}
-rw-r--r--third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
index b1a9909..72a90ad 100644
--- a/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/DocumentThreadableLoader.cpp
@@ -568,6 +568,11 @@ void DocumentThreadableLoader::handlePreflightResponse(const ResourceResponse& r
void DocumentThreadableLoader::reportResponseReceived(unsigned long identifier, const ResourceResponse& response)
{
LocalFrame* frame = document().frame();
+ // We are seeing crashes caused by nullptr (crbug.com/578849). But the frame
+ // must be set here. TODO(horo): Find the root cause of the unset frame.
+ ASSERT(frame);
+ if (!frame)
+ return;
DocumentLoader* loader = frame->loader().documentLoader();
TRACE_EVENT_INSTANT1("devtools.timeline", "ResourceReceiveResponse", TRACE_EVENT_SCOPE_THREAD, "data", InspectorReceiveResponseEvent::data(identifier, frame, response));
InspectorInstrumentation::didReceiveResourceResponse(frame, identifier, loader, response, resource() ? resource()->loader() : 0);