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

Side by Side Diff: third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Issue 2700293002: DevTools: do not use RAII for sync native breakpoints, reuse AsyncTask where possible. (Closed)
Patch Set: Introduce progress monitor Created 3 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2011 Google 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 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. 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 11 matching lines...) Expand all
22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 */ 28 */
29 29
30 #include "core/loader/DocumentLoader.h" 30 #include "core/loader/DocumentLoader.h"
31 31
32 #include <memory>
caseq 2017/02/21 21:04:27 add empty line
32 #include "core/dom/Document.h" 33 #include "core/dom/Document.h"
33 #include "core/dom/WeakIdentifierMap.h" 34 #include "core/dom/WeakIdentifierMap.h"
34 #include "core/events/Event.h" 35 #include "core/events/Event.h"
35 #include "core/frame/Deprecation.h" 36 #include "core/frame/Deprecation.h"
36 #include "core/frame/FrameHost.h" 37 #include "core/frame/FrameHost.h"
37 #include "core/frame/LocalDOMWindow.h" 38 #include "core/frame/LocalDOMWindow.h"
38 #include "core/frame/LocalFrame.h" 39 #include "core/frame/LocalFrame.h"
39 #include "core/frame/Settings.h" 40 #include "core/frame/Settings.h"
40 #include "core/frame/csp/ContentSecurityPolicy.h" 41 #include "core/frame/csp/ContentSecurityPolicy.h"
41 #include "core/html/HTMLFrameOwnerElement.h" 42 #include "core/html/HTMLFrameOwnerElement.h"
42 #include "core/html/parser/TextResourceDecoder.h" 43 #include "core/html/parser/TextResourceDecoder.h"
43 #include "core/inspector/ConsoleMessage.h" 44 #include "core/inspector/ConsoleMessage.h"
44 #include "core/inspector/InspectorInstrumentation.h" 45 #include "core/inspector/InspectorInstrumentation.h"
46 #include "core/inspector/MainThreadDebugger.h"
45 #include "core/loader/FrameFetchContext.h" 47 #include "core/loader/FrameFetchContext.h"
46 #include "core/loader/FrameLoader.h" 48 #include "core/loader/FrameLoader.h"
47 #include "core/loader/FrameLoaderClient.h" 49 #include "core/loader/FrameLoaderClient.h"
48 #include "core/loader/LinkLoader.h" 50 #include "core/loader/LinkLoader.h"
49 #include "core/loader/NetworkHintsInterface.h" 51 #include "core/loader/NetworkHintsInterface.h"
50 #include "core/loader/ProgressTracker.h" 52 #include "core/loader/ProgressTracker.h"
51 #include "core/loader/appcache/ApplicationCacheHost.h" 53 #include "core/loader/appcache/ApplicationCacheHost.h"
52 #include "core/loader/resource/CSSStyleSheetResource.h" 54 #include "core/loader/resource/CSSStyleSheetResource.h"
53 #include "core/loader/resource/FontResource.h" 55 #include "core/loader/resource/FontResource.h"
54 #include "core/loader/resource/ImageResource.h" 56 #include "core/loader/resource/ImageResource.h"
(...skipping 12 matching lines...) Expand all
67 #include "platform/network/HTTPParsers.h" 69 #include "platform/network/HTTPParsers.h"
68 #include "platform/network/mime/MIMETypeRegistry.h" 70 #include "platform/network/mime/MIMETypeRegistry.h"
69 #include "platform/plugins/PluginData.h" 71 #include "platform/plugins/PluginData.h"
70 #include "platform/weborigin/SchemeRegistry.h" 72 #include "platform/weborigin/SchemeRegistry.h"
71 #include "platform/weborigin/SecurityPolicy.h" 73 #include "platform/weborigin/SecurityPolicy.h"
72 #include "public/platform/Platform.h" 74 #include "public/platform/Platform.h"
73 #include "public/platform/WebDocumentSubresourceFilter.h" 75 #include "public/platform/WebDocumentSubresourceFilter.h"
74 #include "wtf/Assertions.h" 76 #include "wtf/Assertions.h"
75 #include "wtf/AutoReset.h" 77 #include "wtf/AutoReset.h"
76 #include "wtf/text/WTFString.h" 78 #include "wtf/text/WTFString.h"
77 #include <memory>
78 79
79 namespace blink { 80 namespace blink {
80 81
81 static bool isArchiveMIMEType(const String& mimeType) { 82 static bool isArchiveMIMEType(const String& mimeType) {
82 return equalIgnoringCase("multipart/related", mimeType); 83 return equalIgnoringCase("multipart/related", mimeType);
83 } 84 }
84 85
85 static bool shouldInheritSecurityOriginFromOwner(const KURL& url) { 86 static bool shouldInheritSecurityOriginFromOwner(const KURL& url) {
86 // https://html.spec.whatwg.org/multipage/browsers.html#origin 87 // https://html.spec.whatwg.org/multipage/browsers.html#origin
87 // 88 //
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 m_mainResource.get()); 305 m_mainResource.get());
305 } 306 }
306 307
307 frameLoader().loadFailed(this, m_mainResource->resourceError()); 308 frameLoader().loadFailed(this, m_mainResource->resourceError());
308 clearMainResourceHandle(); 309 clearMainResourceHandle();
309 } 310 }
310 311
311 void DocumentLoader::finishedLoading(double finishTime) { 312 void DocumentLoader::finishedLoading(double finishTime) {
312 DCHECK(m_frame->loader().stateMachine()->creatingInitialEmptyDocument() || 313 DCHECK(m_frame->loader().stateMachine()->creatingInitialEmptyDocument() ||
313 !m_frame->page()->suspended() || 314 !m_frame->page()->suspended() ||
314 InspectorInstrumentation::isDebuggerPaused(m_frame)); 315 MainThreadDebugger::instance()->isPaused());
315 316
316 double responseEndTime = finishTime; 317 double responseEndTime = finishTime;
317 if (!responseEndTime) 318 if (!responseEndTime)
318 responseEndTime = m_timeOfLastDataReceived; 319 responseEndTime = m_timeOfLastDataReceived;
319 if (!responseEndTime) 320 if (!responseEndTime)
320 responseEndTime = monotonicallyIncreasingTime(); 321 responseEndTime = monotonicallyIncreasingTime();
321 timing().setResponseEnd(responseEndTime); 322 timing().setResponseEnd(responseEndTime);
322 323
323 commitIfReady(); 324 commitIfReady();
324 if (!m_frame) 325 if (!m_frame)
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 m_writer ? m_writer->encoding() : emptyAtom, true, 814 m_writer ? m_writer->encoding() : emptyAtom, true,
814 ForceSynchronousParsing); 815 ForceSynchronousParsing);
815 if (!source.isNull()) 816 if (!source.isNull())
816 m_writer->appendReplacingData(source); 817 m_writer->appendReplacingData(source);
817 endWriting(); 818 endWriting();
818 } 819 }
819 820
820 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 821 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
821 822
822 } // namespace blink 823 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698