| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 void FrameLoaderClientImpl::dispatchWillClose() | 461 void FrameLoaderClientImpl::dispatchWillClose() |
| 462 { | 462 { |
| 463 if (m_webFrame->client()) | 463 if (m_webFrame->client()) |
| 464 m_webFrame->client()->willClose(m_webFrame); | 464 m_webFrame->client()->willClose(m_webFrame); |
| 465 } | 465 } |
| 466 | 466 |
| 467 void FrameLoaderClientImpl::dispatchDidStartProvisionalLoad(double triggeringEve
ntTime) | 467 void FrameLoaderClientImpl::dispatchDidStartProvisionalLoad(double triggeringEve
ntTime) |
| 468 { | 468 { |
| 469 if (m_webFrame->client()) | 469 if (m_webFrame->client()) |
| 470 m_webFrame->client()->didStartProvisionalLoad(m_webFrame, triggeringEven
tTime); | 470 m_webFrame->client()->didStartProvisionalLoad(m_webFrame, triggeringEven
tTime); |
| 471 if (WebDevToolsAgentImpl* devTools = devToolsAgent()) |
| 472 devTools->didStartProvisionalLoad(m_webFrame->frame()); |
| 471 } | 473 } |
| 472 | 474 |
| 473 void FrameLoaderClientImpl::dispatchDidReceiveTitle(const String& title) | 475 void FrameLoaderClientImpl::dispatchDidReceiveTitle(const String& title) |
| 474 { | 476 { |
| 475 if (m_webFrame->client()) | 477 if (m_webFrame->client()) |
| 476 m_webFrame->client()->didReceiveTitle(m_webFrame, title, WebTextDirectio
nLeftToRight); | 478 m_webFrame->client()->didReceiveTitle(m_webFrame, title, WebTextDirectio
nLeftToRight); |
| 477 } | 479 } |
| 478 | 480 |
| 479 void FrameLoaderClientImpl::dispatchDidChangeIcons(IconType type) | 481 void FrameLoaderClientImpl::dispatchDidChangeIcons(IconType type) |
| 480 { | 482 { |
| 481 if (m_webFrame->client()) | 483 if (m_webFrame->client()) |
| 482 m_webFrame->client()->didChangeIcon(m_webFrame, static_cast<WebIconURL::
Type>(type)); | 484 m_webFrame->client()->didChangeIcon(m_webFrame, static_cast<WebIconURL::
Type>(type)); |
| 483 } | 485 } |
| 484 | 486 |
| 485 void FrameLoaderClientImpl::dispatchDidCommitLoad(HistoryItem* item, HistoryComm
itType commitType) | 487 void FrameLoaderClientImpl::dispatchDidCommitLoad(HistoryItem* item, HistoryComm
itType commitType) |
| 486 { | 488 { |
| 487 if (!m_webFrame->parent()) { | 489 if (!m_webFrame->parent()) { |
| 488 m_webFrame->viewImpl()->didCommitLoad(commitType == StandardCommit, fals
e); | 490 m_webFrame->viewImpl()->didCommitLoad(commitType == StandardCommit, fals
e); |
| 489 } | 491 } |
| 490 | 492 |
| 491 // Save some histogram data so we can compute the average memory used per | 493 // Save some histogram data so we can compute the average memory used per |
| 492 // page load of the glyphs. | 494 // page load of the glyphs. |
| 493 // TODO(esprehn): Is this ancient uma actually useful? | 495 // TODO(esprehn): Is this ancient uma actually useful? |
| 494 DEFINE_STATIC_LOCAL(CustomCountHistogram, gyphsPagesPerLoadHistogram, ("Memo
ry.GlyphPagesPerLoad", 1, 10000, 50)); | 496 DEFINE_STATIC_LOCAL(CustomCountHistogram, gyphsPagesPerLoadHistogram, ("Memo
ry.GlyphPagesPerLoad", 1, 10000, 50)); |
| 495 gyphsPagesPerLoadHistogram.count(GlyphPageTreeNode::treeGlyphPageCount()); | 497 gyphsPagesPerLoadHistogram.count(GlyphPageTreeNode::treeGlyphPageCount()); |
| 496 | 498 |
| 497 if (m_webFrame->client()) | 499 if (m_webFrame->client()) |
| 498 m_webFrame->client()->didCommitProvisionalLoad(m_webFrame, WebHistoryIte
m(item), static_cast<WebHistoryCommitType>(commitType)); | 500 m_webFrame->client()->didCommitProvisionalLoad(m_webFrame, WebHistoryIte
m(item), static_cast<WebHistoryCommitType>(commitType)); |
| 499 WebDevToolsAgentImpl* devToolsAgent = WebLocalFrameImpl::fromFrame(m_webFram
e->frame()->localFrameRoot())->devToolsAgentImpl(); | 501 if (WebDevToolsAgentImpl* devTools = devToolsAgent()) |
| 500 if (devToolsAgent) | 502 devTools->didCommitLoadForLocalFrame(m_webFrame->frame()); |
| 501 devToolsAgent->didCommitLoadForLocalFrame(m_webFrame->frame()); | |
| 502 } | 503 } |
| 503 | 504 |
| 504 void FrameLoaderClientImpl::dispatchDidFailProvisionalLoad( | 505 void FrameLoaderClientImpl::dispatchDidFailProvisionalLoad( |
| 505 const ResourceError& error, HistoryCommitType commitType) | 506 const ResourceError& error, HistoryCommitType commitType) |
| 506 { | 507 { |
| 507 m_webFrame->didFail(error, true, commitType); | 508 m_webFrame->didFail(error, true, commitType); |
| 508 } | 509 } |
| 509 | 510 |
| 510 void FrameLoaderClientImpl::dispatchDidFailLoad(const ResourceError& error, Hist
oryCommitType commitType) | 511 void FrameLoaderClientImpl::dispatchDidFailLoad(const ResourceError& error, Hist
oryCommitType commitType) |
| 511 { | 512 { |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1030 return ServiceWorkerLinkResource::create(owner); | 1031 return ServiceWorkerLinkResource::create(owner); |
| 1031 } | 1032 } |
| 1032 | 1033 |
| 1033 WebEffectiveConnectionType FrameLoaderClientImpl::getEffectiveConnectionType() | 1034 WebEffectiveConnectionType FrameLoaderClientImpl::getEffectiveConnectionType() |
| 1034 { | 1035 { |
| 1035 if (m_webFrame->client()) | 1036 if (m_webFrame->client()) |
| 1036 return m_webFrame->client()->getEffectiveConnectionType(); | 1037 return m_webFrame->client()->getEffectiveConnectionType(); |
| 1037 return WebEffectiveConnectionType::TypeUnknown; | 1038 return WebEffectiveConnectionType::TypeUnknown; |
| 1038 } | 1039 } |
| 1039 | 1040 |
| 1041 WebDevToolsAgentImpl* FrameLoaderClientImpl::devToolsAgent() |
| 1042 { |
| 1043 return WebLocalFrameImpl::fromFrame(m_webFrame->frame()->localFrameRoot())->
devToolsAgentImpl(); |
| 1044 } |
| 1045 |
| 1040 } // namespace blink | 1046 } // namespace blink |
| OLD | NEW |