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

Side by Side Diff: Source/WebCore/inspector/InspectorResourceAgent.cpp

Issue 7819001: Merge 94078 - Web Inspector: Inspected page sometimes crashes in InspectorResourceAgent::didFailL... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 3 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 | « no previous file | 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 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 293
294 if (!finishTime) 294 if (!finishTime)
295 finishTime = currentTime(); 295 finishTime = currentTime();
296 296
297 m_frontend->loadingFinished(resourceId, finishTime); 297 m_frontend->loadingFinished(resourceId, finishTime);
298 } 298 }
299 299
300 void InspectorResourceAgent::didFailLoading(unsigned long identifier, DocumentLo ader* loader, const ResourceError& error) 300 void InspectorResourceAgent::didFailLoading(unsigned long identifier, DocumentLo ader* loader, const ResourceError& error)
301 { 301 {
302 String resourceId = IdentifiersFactory::resourceId(identifier); 302 String resourceId = IdentifiersFactory::resourceId(identifier);
303 if (m_resourcesData->resourceType(resourceId) == InspectorPageAgent::Documen tResource) 303
304 m_resourcesData->addResourceSharedBuffer(resourceId, loader->frameLoader ()->documentLoader()->mainResourceData(), loader->frame()->document()->inputEnco ding()); 304 if (m_resourcesData->resourceType(resourceId) == InspectorPageAgent::Documen tResource) {
305 Frame* frame = loader ? loader->frame() : 0;
306 if (frame && frame->loader()->documentLoader() && frame->document())
307 m_resourcesData->addResourceSharedBuffer(resourceId, frame->loader() ->documentLoader()->mainResourceData(), frame->document()->inputEncoding());
308 }
305 309
306 m_frontend->loadingFailed(resourceId, currentTime(), error.localizedDescript ion(), error.isCancellation()); 310 m_frontend->loadingFailed(resourceId, currentTime(), error.localizedDescript ion(), error.isCancellation());
307 } 311 }
308 312
309 void InspectorResourceAgent::didLoadResourceFromMemoryCache(DocumentLoader* load er, CachedResource* resource) 313 void InspectorResourceAgent::didLoadResourceFromMemoryCache(DocumentLoader* load er, CachedResource* resource)
310 { 314 {
311 String loaderId = m_pageAgent->loaderId(loader); 315 String loaderId = m_pageAgent->loaderId(loader);
312 String frameId = m_pageAgent->frameId(loader->frame()); 316 String frameId = m_pageAgent->frameId(loader->frame());
313 unsigned long identifier = loader->frame()->page()->progress()->createUnique Identifier(); 317 unsigned long identifier = loader->frame()->page()->progress()->createUnique Identifier();
314 String resourceId = IdentifiersFactory::resourceId(identifier); 318 String resourceId = IdentifiersFactory::resourceId(identifier);
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 // Create mock frontend, so we can collect network events. 537 // Create mock frontend, so we can collect network events.
534 m_frontend = m_mockFrontend.get(); 538 m_frontend = m_mockFrontend.get();
535 enable(); 539 enable();
536 } else 540 } else
537 m_frontend = 0; 541 m_frontend = 0;
538 } 542 }
539 543
540 } // namespace WebCore 544 } // namespace WebCore
541 545
542 #endif // ENABLE(INSPECTOR) 546 #endif // ENABLE(INSPECTOR)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698