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

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

Issue 2151933003: Change WTF::TemporaryChange to be an alias for AutoReset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: TemporaryChange -> AutoReset Created 4 years, 5 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 #include "platform/mhtml/ArchiveResource.h" 66 #include "platform/mhtml/ArchiveResource.h"
67 #include "platform/network/ContentSecurityPolicyResponseHeaders.h" 67 #include "platform/network/ContentSecurityPolicyResponseHeaders.h"
68 #include "platform/network/HTTPParsers.h" 68 #include "platform/network/HTTPParsers.h"
69 #include "platform/plugins/PluginData.h" 69 #include "platform/plugins/PluginData.h"
70 #include "platform/weborigin/SchemeRegistry.h" 70 #include "platform/weborigin/SchemeRegistry.h"
71 #include "platform/weborigin/SecurityPolicy.h" 71 #include "platform/weborigin/SecurityPolicy.h"
72 #include "public/platform/Platform.h" 72 #include "public/platform/Platform.h"
73 #include "public/platform/WebDocumentSubresourceFilter.h" 73 #include "public/platform/WebDocumentSubresourceFilter.h"
74 #include "public/platform/WebMimeRegistry.h" 74 #include "public/platform/WebMimeRegistry.h"
75 #include "wtf/Assertions.h" 75 #include "wtf/Assertions.h"
76 #include "wtf/TemporaryChange.h" 76 #include "wtf/AutoReset.h"
77 #include "wtf/text/WTFString.h" 77 #include "wtf/text/WTFString.h"
78 #include <memory> 78 #include <memory>
79 79
80 namespace blink { 80 namespace blink {
81 81
82 static bool isArchiveMIMEType(const String& mimeType) 82 static bool isArchiveMIMEType(const String& mimeType)
83 { 83 {
84 return equalIgnoringCase("multipart/related", mimeType); 84 return equalIgnoringCase("multipart/related", mimeType);
85 } 85 }
86 86
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 // data to the top-level invocation. Reentrant calls can occur because 500 // data to the top-level invocation. Reentrant calls can occur because
501 // of web platform (mis-)features that require running a nested message 501 // of web platform (mis-)features that require running a nested message
502 // loop: 502 // loop:
503 // - alert(), confirm(), prompt() 503 // - alert(), confirm(), prompt()
504 // - Detach of plugin elements. 504 // - Detach of plugin elements.
505 // - Synchronous XMLHTTPRequest 505 // - Synchronous XMLHTTPRequest
506 m_dataBuffer->append(data, length); 506 m_dataBuffer->append(data, length);
507 return; 507 return;
508 } 508 }
509 509
510 TemporaryChange<bool> reentrancyProtector(m_inDataReceived, true); 510 AutoReset<bool> reentrancyProtector(&m_inDataReceived, true);
511 processData(data, length); 511 processData(data, length);
512 512
513 // Process data received in reentrant invocations. Note that the 513 // Process data received in reentrant invocations. Note that the
514 // invocations of processData() may queue more data in reentrant 514 // invocations of processData() may queue more data in reentrant
515 // invocations, so iterate until it's empty. 515 // invocations, so iterate until it's empty.
516 const char* segment; 516 const char* segment;
517 size_t pos = 0; 517 size_t pos = 0;
518 while (size_t length = m_dataBuffer->getSomeData(segment, pos)) { 518 while (size_t length = m_dataBuffer->getSomeData(segment, pos)) {
519 processData(segment, length); 519 processData(segment, length);
520 pos += length; 520 pos += length;
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 { 705 {
706 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true, ForceSynchronousParsing); 706 m_writer = createWriterFor(init, mimeType(), m_writer ? m_writer->encoding() : emptyAtom, true, ForceSynchronousParsing);
707 if (!source.isNull()) 707 if (!source.isNull())
708 m_writer->appendReplacingData(source); 708 m_writer->appendReplacingData(source);
709 endWriting(m_writer.get()); 709 endWriting(m_writer.get());
710 } 710 }
711 711
712 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 712 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
713 713
714 } // namespace blink 714 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698