OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. |
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> | 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> |
8 * Copyright (C) 2011 Google Inc. All rights reserved. | 8 * Copyright (C) 2011 Google Inc. All rights reserved. |
9 * | 9 * |
10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 request.setSkipServiceWorker(frameLoadType == FrameLoadTypeReloadBypassingCa
che ? WebURLRequest::SkipServiceWorker::All : WebURLRequest::SkipServiceWorker::
None); | 174 request.setSkipServiceWorker(frameLoadType == FrameLoadTypeReloadBypassingCa
che ? WebURLRequest::SkipServiceWorker::All : WebURLRequest::SkipServiceWorker::
None); |
175 return request; | 175 return request; |
176 } | 176 } |
177 | 177 |
178 FrameLoader::FrameLoader(LocalFrame* frame) | 178 FrameLoader::FrameLoader(LocalFrame* frame) |
179 : m_frame(frame) | 179 : m_frame(frame) |
180 , m_progressTracker(ProgressTracker::create(frame)) | 180 , m_progressTracker(ProgressTracker::create(frame)) |
181 , m_loadType(FrameLoadTypeStandard) | 181 , m_loadType(FrameLoadTypeStandard) |
182 , m_inStopAllLoaders(false) | 182 , m_inStopAllLoaders(false) |
183 , m_checkTimer(TaskRunnerHelper::getLoadingTaskRunner(frame), this, &FrameLo
ader::checkTimerFired) | 183 , m_checkTimer(TaskRunnerHelper::getLoadingTaskRunner(frame), this, &FrameLo
ader::checkTimerFired) |
184 , m_didAccessInitialDocument(false) | |
185 , m_forcedSandboxFlags(SandboxNone) | 184 , m_forcedSandboxFlags(SandboxNone) |
186 , m_dispatchingDidClearWindowObjectInMainWorld(false) | 185 , m_dispatchingDidClearWindowObjectInMainWorld(false) |
187 , m_protectProvisionalLoader(false) | 186 , m_protectProvisionalLoader(false) |
188 { | 187 { |
189 TRACE_EVENT_OBJECT_CREATED_WITH_ID("loading", "FrameLoader", this); | 188 TRACE_EVENT_OBJECT_CREATED_WITH_ID("loading", "FrameLoader", this); |
190 takeObjectSnapshot(); | 189 takeObjectSnapshot(); |
191 } | 190 } |
192 | 191 |
193 FrameLoader::~FrameLoader() | 192 FrameLoader::~FrameLoader() |
194 { | 193 { |
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 // committing an empty document. In that case, emulate a failed navigation. | 1069 // committing an empty document. In that case, emulate a failed navigation. |
1071 if (!m_provisionalDocumentLoader && m_documentLoader && m_frame->isLoading()
) | 1070 if (!m_provisionalDocumentLoader && m_documentLoader && m_frame->isLoading()
) |
1072 loadFailed(m_documentLoader.get(), ResourceError::cancelledError(m_docum
entLoader->url())); | 1071 loadFailed(m_documentLoader.get(), ResourceError::cancelledError(m_docum
entLoader->url())); |
1073 | 1072 |
1074 m_inStopAllLoaders = false; | 1073 m_inStopAllLoaders = false; |
1075 takeObjectSnapshot(); | 1074 takeObjectSnapshot(); |
1076 } | 1075 } |
1077 | 1076 |
1078 void FrameLoader::didAccessInitialDocument() | 1077 void FrameLoader::didAccessInitialDocument() |
1079 { | 1078 { |
1080 // We only need to notify the client once, and only for the main frame. | 1079 // We only need to notify the client for the main frame. |
1081 if (isLoadingMainFrame() && !m_didAccessInitialDocument) { | 1080 if (isLoadingMainFrame()) { |
1082 m_didAccessInitialDocument = true; | |
1083 | |
1084 // Forbid script execution to prevent re-entering V8, since this is | 1081 // Forbid script execution to prevent re-entering V8, since this is |
1085 // called from a binding security check. | 1082 // called from a binding security check. |
1086 ScriptForbiddenScope forbidScripts; | 1083 ScriptForbiddenScope forbidScripts; |
1087 if (client()) | 1084 if (client()) |
1088 client()->didAccessInitialDocument(); | 1085 client()->didAccessInitialDocument(); |
1089 } | 1086 } |
1090 } | 1087 } |
1091 | 1088 |
1092 bool FrameLoader::prepareForCommit() | 1089 bool FrameLoader::prepareForCommit() |
1093 { | 1090 { |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1623 tracedValue->setString("documentLoaderURL", m_documentLoader ? m_documentLoa
der->url() : String()); | 1620 tracedValue->setString("documentLoaderURL", m_documentLoader ? m_documentLoa
der->url() : String()); |
1624 return tracedValue; | 1621 return tracedValue; |
1625 } | 1622 } |
1626 | 1623 |
1627 inline void FrameLoader::takeObjectSnapshot() const | 1624 inline void FrameLoader::takeObjectSnapshot() const |
1628 { | 1625 { |
1629 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, toTraced
Value()); | 1626 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, toTraced
Value()); |
1630 } | 1627 } |
1631 | 1628 |
1632 } // namespace blink | 1629 } // namespace blink |
OLD | NEW |