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

Side by Side Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2786673002: Separate ContentSettingsClient out from LocalFrameClient (Closed)
Patch Set: dchecks Created 3 years, 8 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 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 #include "core/editing/spellcheck/SpellChecker.h" 128 #include "core/editing/spellcheck/SpellChecker.h"
129 #include "core/events/BeforeUnloadEvent.h" 129 #include "core/events/BeforeUnloadEvent.h"
130 #include "core/events/Event.h" 130 #include "core/events/Event.h"
131 #include "core/events/EventFactory.h" 131 #include "core/events/EventFactory.h"
132 #include "core/events/EventListener.h" 132 #include "core/events/EventListener.h"
133 #include "core/events/HashChangeEvent.h" 133 #include "core/events/HashChangeEvent.h"
134 #include "core/events/PageTransitionEvent.h" 134 #include "core/events/PageTransitionEvent.h"
135 #include "core/events/ScopedEventQueue.h" 135 #include "core/events/ScopedEventQueue.h"
136 #include "core/events/VisualViewportResizeEvent.h" 136 #include "core/events/VisualViewportResizeEvent.h"
137 #include "core/events/VisualViewportScrollEvent.h" 137 #include "core/events/VisualViewportScrollEvent.h"
138 #include "core/frame/ContentSettingsClient.h"
138 #include "core/frame/DOMTimer.h" 139 #include "core/frame/DOMTimer.h"
139 #include "core/frame/DOMVisualViewport.h" 140 #include "core/frame/DOMVisualViewport.h"
140 #include "core/frame/EventHandlerRegistry.h" 141 #include "core/frame/EventHandlerRegistry.h"
141 #include "core/frame/FrameConsole.h" 142 #include "core/frame/FrameConsole.h"
142 #include "core/frame/FrameView.h" 143 #include "core/frame/FrameView.h"
143 #include "core/frame/History.h" 144 #include "core/frame/History.h"
144 #include "core/frame/HostsUsingFeatures.h" 145 #include "core/frame/HostsUsingFeatures.h"
145 #include "core/frame/LocalDOMWindow.h" 146 #include "core/frame/LocalDOMWindow.h"
146 #include "core/frame/LocalFrame.h" 147 #include "core/frame/LocalFrame.h"
147 #include "core/frame/LocalFrameClient.h" 148 #include "core/frame/LocalFrameClient.h"
(...skipping 5484 matching lines...) Expand 10 before | Expand all | Expand 10 after
5632 "Blocked script execution in '" + url().elidedString() + 5633 "Blocked script execution in '" + url().elidedString() +
5633 "' because the document's frame is sandboxed and the " 5634 "' because the document's frame is sandboxed and the "
5634 "'allow-scripts' permission is not set.")); 5635 "'allow-scripts' permission is not set."));
5635 } 5636 }
5636 return false; 5637 return false;
5637 } 5638 }
5638 5639
5639 DCHECK(frame()) 5640 DCHECK(frame())
5640 << "you are querying canExecuteScripts on a non contextDocument."; 5641 << "you are querying canExecuteScripts on a non contextDocument.";
5641 5642
5642 LocalFrameClient* client = frame()->loader().client(); 5643 ContentSettingsClient* settingsClient = frame()->contentSettingsClient();
5643 if (!client) 5644 if (!settingsClient)
5644 return false; 5645 return false;
5645 5646
5646 Settings* settings = frame()->settings(); 5647 Settings* settings = frame()->settings();
5647 if (!client->allowScript(settings && settings->getScriptEnabled())) { 5648 if (!settingsClient->allowScript(settings && settings->getScriptEnabled())) {
5648 if (reason == AboutToExecuteScript) 5649 if (reason == AboutToExecuteScript)
5649 client->didNotAllowScript(); 5650 settingsClient->didNotAllowScript();
5650 5651
5651 return false; 5652 return false;
5652 } 5653 }
5653 5654
5654 return true; 5655 return true;
5655 } 5656 }
5656 5657
5657 bool Document::isRenderingReady() const { 5658 bool Document::isRenderingReady() const {
5658 return m_styleEngine->ignoringPendingStylesheets() || 5659 return m_styleEngine->ignoringPendingStylesheets() ||
5659 (haveImportsLoaded() && haveRenderBlockingStylesheetsLoaded()); 5660 (haveImportsLoaded() && haveRenderBlockingStylesheetsLoaded());
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after
6641 } 6642 }
6642 6643
6643 void showLiveDocumentInstances() { 6644 void showLiveDocumentInstances() {
6644 WeakDocumentSet& set = liveDocumentSet(); 6645 WeakDocumentSet& set = liveDocumentSet();
6645 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6646 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6646 for (blink::Document* document : set) 6647 for (blink::Document* document : set)
6647 fprintf(stderr, "- Document %p URL: %s\n", document, 6648 fprintf(stderr, "- Document %p URL: %s\n", document,
6648 document->url().getString().utf8().data()); 6649 document->url().getString().utf8().data());
6649 } 6650 }
6650 #endif 6651 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698