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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 #include "platform/scroll/ScrollbarTheme.h" 227 #include "platform/scroll/ScrollbarTheme.h"
228 #include "platform/text/PlatformLocale.h" 228 #include "platform/text/PlatformLocale.h"
229 #include "platform/text/SegmentedString.h" 229 #include "platform/text/SegmentedString.h"
230 #include "platform/weborigin/OriginAccessEntry.h" 230 #include "platform/weborigin/OriginAccessEntry.h"
231 #include "platform/weborigin/SchemeRegistry.h" 231 #include "platform/weborigin/SchemeRegistry.h"
232 #include "platform/weborigin/SecurityOrigin.h" 232 #include "platform/weborigin/SecurityOrigin.h"
233 #include "public/platform/Platform.h" 233 #include "public/platform/Platform.h"
234 #include "public/platform/WebAddressSpace.h" 234 #include "public/platform/WebAddressSpace.h"
235 #include "public/platform/WebFrameScheduler.h" 235 #include "public/platform/WebFrameScheduler.h"
236 #include "public/platform/WebScheduler.h" 236 #include "public/platform/WebScheduler.h"
237 #include "wtf/AutoReset.h"
237 #include "wtf/CurrentTime.h" 238 #include "wtf/CurrentTime.h"
238 #include "wtf/DateMath.h" 239 #include "wtf/DateMath.h"
239 #include "wtf/Functional.h" 240 #include "wtf/Functional.h"
240 #include "wtf/HashFunctions.h" 241 #include "wtf/HashFunctions.h"
241 #include "wtf/PtrUtil.h" 242 #include "wtf/PtrUtil.h"
242 #include "wtf/StdLibExtras.h" 243 #include "wtf/StdLibExtras.h"
243 #include "wtf/TemporaryChange.h"
244 #include "wtf/text/StringBuffer.h" 244 #include "wtf/text/StringBuffer.h"
245 #include "wtf/text/TextEncodingRegistry.h" 245 #include "wtf/text/TextEncodingRegistry.h"
246 #include <memory> 246 #include <memory>
247 247
248 using namespace WTF; 248 using namespace WTF;
249 using namespace Unicode; 249 using namespace Unicode;
250 250
251 #ifndef NDEBUG 251 #ifndef NDEBUG
252 using WeakDocumentSet = blink::PersistentHeapHashSet<blink::WeakMember<blink::Do cument>>; 252 using WeakDocumentSet = blink::PersistentHeapHashSet<blink::WeakMember<blink::Do cument>>;
253 static WeakDocumentSet& liveDocumentSet(); 253 static WeakDocumentSet& liveDocumentSet();
(...skipping 4224 matching lines...) Expand 10 before | Expand all | Expand 10 after
4478 // We don't allow recursive |execCommand()| to protect against attack code. 4478 // We don't allow recursive |execCommand()| to protect against attack code.
4479 // Recursive call of |execCommand()| could be happened by moving iframe 4479 // Recursive call of |execCommand()| could be happened by moving iframe
4480 // with script triggered by insertion, e.g. <iframe src="javascript:..."> 4480 // with script triggered by insertion, e.g. <iframe src="javascript:...">
4481 // <iframe onload="...">. This usage is valid as of the specification 4481 // <iframe onload="...">. This usage is valid as of the specification
4482 // although, it isn't common use case, rather it is used as attack code. 4482 // although, it isn't common use case, rather it is used as attack code.
4483 if (m_isRunningExecCommand) { 4483 if (m_isRunningExecCommand) {
4484 String message = "We don't execute document.execCommand() this time, bec ause it is called recursively."; 4484 String message = "We don't execute document.execCommand() this time, bec ause it is called recursively.";
4485 addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessage Level, message)); 4485 addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessage Level, message));
4486 return false; 4486 return false;
4487 } 4487 }
4488 TemporaryChange<bool> executeScope(m_isRunningExecCommand, true); 4488 AutoReset<bool> executeScope(&m_isRunningExecCommand, true);
4489 4489
4490 // Postpone DOM mutation events, which can execute scripts and change 4490 // Postpone DOM mutation events, which can execute scripts and change
4491 // DOM tree against implementation assumption. 4491 // DOM tree against implementation assumption.
4492 EventQueueScope eventQueueScope; 4492 EventQueueScope eventQueueScope;
4493 Editor::tidyUpHTMLStructure(*this); 4493 Editor::tidyUpHTMLStructure(*this);
4494 Editor::Command editorCommand = command(this, commandName); 4494 Editor::Command editorCommand = command(this, commandName);
4495 4495
4496 DEFINE_STATIC_LOCAL(SparseHistogram, editorCommandHistogram, ("WebCore.Docum ent.execCommand")); 4496 DEFINE_STATIC_LOCAL(SparseHistogram, editorCommandHistogram, ("WebCore.Docum ent.execCommand"));
4497 editorCommandHistogram.sample(editorCommand.idForHistogram()); 4497 editorCommandHistogram.sample(editorCommand.idForHistogram());
4498 return editorCommand.execute(value); 4498 return editorCommand.execute(value);
(...skipping 1540 matching lines...) Expand 10 before | Expand all | Expand 10 after
6039 } 6039 }
6040 6040
6041 void showLiveDocumentInstances() 6041 void showLiveDocumentInstances()
6042 { 6042 {
6043 WeakDocumentSet& set = liveDocumentSet(); 6043 WeakDocumentSet& set = liveDocumentSet();
6044 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6044 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6045 for (Document* document : set) 6045 for (Document* document : set)
6046 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6046 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6047 } 6047 }
6048 #endif 6048 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/DOMURL.cpp ('k') | third_party/WebKit/Source/core/dom/FirstLetterPseudoElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698