OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 | 338 |
339 return true; | 339 return true; |
340 } | 340 } |
341 | 341 |
342 void PingLoaderImpl::didReceiveResponse(const WebURLResponse& response) { | 342 void PingLoaderImpl::didReceiveResponse(const WebURLResponse& response) { |
343 if (frame()) { | 343 if (frame()) { |
344 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", | 344 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", |
345 InspectorResourceFinishEvent::data(m_identifier, 0, true, 0)); | 345 InspectorResourceFinishEvent::data(m_identifier, 0, true, 0)); |
346 const ResourceResponse& resourceResponse = response.toResourceResponse(); | 346 const ResourceResponse& resourceResponse = response.toResourceResponse(); |
347 InspectorInstrumentation::didReceiveResourceResponse( | 347 InspectorInstrumentation::didReceiveResourceResponse( |
348 frame(), m_identifier, 0, resourceResponse, 0); | 348 frame()->document(), m_identifier, 0, resourceResponse, 0); |
349 didFailLoading(frame()); | 349 didFailLoading(frame()); |
350 } | 350 } |
351 dispose(); | 351 dispose(); |
352 } | 352 } |
353 | 353 |
354 void PingLoaderImpl::didReceiveData(const char*, int dataLength) { | 354 void PingLoaderImpl::didReceiveData(const char*, int dataLength) { |
355 if (frame()) { | 355 if (frame()) { |
356 TRACE_EVENT1( | 356 TRACE_EVENT1( |
357 "devtools.timeline", "ResourceFinish", "data", | 357 "devtools.timeline", "ResourceFinish", "data", |
358 InspectorResourceFinishEvent::data(m_identifier, 0, true, dataLength)); | 358 InspectorResourceFinishEvent::data(m_identifier, 0, true, dataLength)); |
(...skipping 30 matching lines...) Expand all Loading... |
389 if (frame()) { | 389 if (frame()) { |
390 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", | 390 TRACE_EVENT1("devtools.timeline", "ResourceFinish", "data", |
391 InspectorResourceFinishEvent::data(m_identifier, 0, true, 0)); | 391 InspectorResourceFinishEvent::data(m_identifier, 0, true, 0)); |
392 didFailLoading(frame()); | 392 didFailLoading(frame()); |
393 } | 393 } |
394 dispose(); | 394 dispose(); |
395 } | 395 } |
396 | 396 |
397 void PingLoaderImpl::didFailLoading(LocalFrame* frame) { | 397 void PingLoaderImpl::didFailLoading(LocalFrame* frame) { |
398 InspectorInstrumentation::didFailLoading( | 398 InspectorInstrumentation::didFailLoading( |
399 frame, m_identifier, ResourceError::cancelledError(m_url)); | 399 frame->document(), m_identifier, ResourceError::cancelledError(m_url)); |
400 frame->console().didFailLoading(m_identifier, | 400 frame->console().didFailLoading(m_identifier, |
401 ResourceError::cancelledError(m_url)); | 401 ResourceError::cancelledError(m_url)); |
402 } | 402 } |
403 | 403 |
404 DEFINE_TRACE(PingLoaderImpl) { | 404 DEFINE_TRACE(PingLoaderImpl) { |
405 ContextClient::trace(visitor); | 405 ContextClient::trace(visitor); |
406 } | 406 } |
407 | 407 |
408 void finishPingRequestInitialization( | 408 void finishPingRequestInitialization( |
409 ResourceRequest& request, | 409 ResourceRequest& request, |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 bool PingLoader::sendBeacon(LocalFrame* frame, | 568 bool PingLoader::sendBeacon(LocalFrame* frame, |
569 int allowance, | 569 int allowance, |
570 const KURL& beaconURL, | 570 const KURL& beaconURL, |
571 Blob* data, | 571 Blob* data, |
572 int& payloadLength) { | 572 int& payloadLength) { |
573 BeaconBlob beacon(data); | 573 BeaconBlob beacon(data); |
574 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); | 574 return sendBeaconCommon(frame, allowance, beaconURL, beacon, payloadLength); |
575 } | 575 } |
576 | 576 |
577 } // namespace blink | 577 } // namespace blink |
OLD | NEW |