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

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: 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 4467 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 TemporaryChange<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 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after
6019 } 6019 }
6020 6020
6021 void showLiveDocumentInstances() 6021 void showLiveDocumentInstances()
6022 { 6022 {
6023 WeakDocumentSet& set = liveDocumentSet(); 6023 WeakDocumentSet& set = liveDocumentSet();
6024 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6024 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6025 for (Document* document : set) 6025 for (Document* document : set)
6026 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6026 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6027 } 6027 }
6028 #endif 6028 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698