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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 request.setSkipServiceWorker(frameLoadType == FrameLoadTypeReloadBypassingCa
che ? WebURLRequest::SkipServiceWorker::All : WebURLRequest::SkipServiceWorker::
None); | 173 request.setSkipServiceWorker(frameLoadType == FrameLoadTypeReloadBypassingCa
che ? WebURLRequest::SkipServiceWorker::All : WebURLRequest::SkipServiceWorker::
None); |
174 return request; | 174 return request; |
175 } | 175 } |
176 | 176 |
177 FrameLoader::FrameLoader(LocalFrame* frame) | 177 FrameLoader::FrameLoader(LocalFrame* frame) |
178 : m_frame(frame) | 178 : m_frame(frame) |
179 , m_progressTracker(ProgressTracker::create(frame)) | 179 , m_progressTracker(ProgressTracker::create(frame)) |
180 , m_loadType(FrameLoadTypeStandard) | 180 , m_loadType(FrameLoadTypeStandard) |
181 , m_inStopAllLoaders(false) | 181 , m_inStopAllLoaders(false) |
182 , m_checkTimer(TaskRunnerHelper::get(TaskType::Networking, frame), this, &Fr
ameLoader::checkTimerFired) | 182 , m_checkTimer(TaskRunnerHelper::get(TaskType::Networking, frame), this, &Fr
ameLoader::checkTimerFired) |
183 , m_didAccessInitialDocument(false) | |
184 , m_forcedSandboxFlags(SandboxNone) | 183 , m_forcedSandboxFlags(SandboxNone) |
185 , m_dispatchingDidClearWindowObjectInMainWorld(false) | 184 , m_dispatchingDidClearWindowObjectInMainWorld(false) |
186 , m_protectProvisionalLoader(false) | 185 , m_protectProvisionalLoader(false) |
187 { | 186 { |
188 TRACE_EVENT_OBJECT_CREATED_WITH_ID("loading", "FrameLoader", this); | 187 TRACE_EVENT_OBJECT_CREATED_WITH_ID("loading", "FrameLoader", this); |
189 takeObjectSnapshot(); | 188 takeObjectSnapshot(); |
190 } | 189 } |
191 | 190 |
192 FrameLoader::~FrameLoader() | 191 FrameLoader::~FrameLoader() |
193 { | 192 { |
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 // committing an empty document. In that case, emulate a failed navigation. | 1065 // committing an empty document. In that case, emulate a failed navigation. |
1067 if (!m_provisionalDocumentLoader && m_documentLoader && m_frame->isLoading()
) | 1066 if (!m_provisionalDocumentLoader && m_documentLoader && m_frame->isLoading()
) |
1068 loadFailed(m_documentLoader.get(), ResourceError::cancelledError(m_docum
entLoader->url())); | 1067 loadFailed(m_documentLoader.get(), ResourceError::cancelledError(m_docum
entLoader->url())); |
1069 | 1068 |
1070 m_inStopAllLoaders = false; | 1069 m_inStopAllLoaders = false; |
1071 takeObjectSnapshot(); | 1070 takeObjectSnapshot(); |
1072 } | 1071 } |
1073 | 1072 |
1074 void FrameLoader::didAccessInitialDocument() | 1073 void FrameLoader::didAccessInitialDocument() |
1075 { | 1074 { |
1076 // We only need to notify the client once, and only for the main frame. | 1075 // We only need to notify the client for the main frame. |
1077 if (isLoadingMainFrame() && !m_didAccessInitialDocument) { | 1076 if (isLoadingMainFrame()) { |
1078 m_didAccessInitialDocument = true; | |
1079 | |
1080 // Forbid script execution to prevent re-entering V8, since this is | 1077 // Forbid script execution to prevent re-entering V8, since this is |
1081 // called from a binding security check. | 1078 // called from a binding security check. |
1082 ScriptForbiddenScope forbidScripts; | 1079 ScriptForbiddenScope forbidScripts; |
1083 if (client()) | 1080 if (client()) |
1084 client()->didAccessInitialDocument(); | 1081 client()->didAccessInitialDocument(); |
1085 } | 1082 } |
1086 } | 1083 } |
1087 | 1084 |
1088 bool FrameLoader::prepareForCommit() | 1085 bool FrameLoader::prepareForCommit() |
1089 { | 1086 { |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1619 tracedValue->setString("documentLoaderURL", m_documentLoader ? m_documentLoa
der->url() : String()); | 1616 tracedValue->setString("documentLoaderURL", m_documentLoader ? m_documentLoa
der->url() : String()); |
1620 return tracedValue; | 1617 return tracedValue; |
1621 } | 1618 } |
1622 | 1619 |
1623 inline void FrameLoader::takeObjectSnapshot() const | 1620 inline void FrameLoader::takeObjectSnapshot() const |
1624 { | 1621 { |
1625 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, toTraced
Value()); | 1622 TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this, toTraced
Value()); |
1626 } | 1623 } |
1627 | 1624 |
1628 } // namespace blink | 1625 } // namespace blink |
OLD | NEW |