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

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

Issue 2786673002: Separate ContentSettingsClient out from LocalFrameClient (Closed)
Patch Set: fix 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 5480 matching lines...) Expand 10 before | Expand all | Expand 10 after
5628 "Blocked script execution in '" + url().elidedString() + 5629 "Blocked script execution in '" + url().elidedString() +
5629 "' because the document's frame is sandboxed and the " 5630 "' because the document's frame is sandboxed and the "
5630 "'allow-scripts' permission is not set.")); 5631 "'allow-scripts' permission is not set."));
5631 } 5632 }
5632 return false; 5633 return false;
5633 } 5634 }
5634 5635
5635 DCHECK(frame()) 5636 DCHECK(frame())
5636 << "you are querying canExecuteScripts on a non contextDocument."; 5637 << "you are querying canExecuteScripts on a non contextDocument.";
5637 5638
5638 LocalFrameClient* client = frame()->loader().client(); 5639 ContentSettingsClient* settingsClient = frame()->contentSettingsClient();
5639 if (!client) 5640 if (!settingsClient)
5640 return false; 5641 return false;
5641 5642
5642 Settings* settings = frame()->settings(); 5643 Settings* settings = frame()->settings();
5643 if (!client->allowScript(settings && settings->getScriptEnabled())) { 5644 if (!settingsClient->allowScript(settings && settings->getScriptEnabled())) {
5644 if (reason == AboutToExecuteScript) 5645 if (reason == AboutToExecuteScript)
5645 client->didNotAllowScript(); 5646 settingsClient->didNotAllowScript();
5646 5647
5647 return false; 5648 return false;
5648 } 5649 }
5649 5650
5650 return true; 5651 return true;
5651 } 5652 }
5652 5653
5653 bool Document::isRenderingReady() const { 5654 bool Document::isRenderingReady() const {
5654 return m_styleEngine->ignoringPendingStylesheets() || 5655 return m_styleEngine->ignoringPendingStylesheets() ||
5655 (haveImportsLoaded() && haveRenderBlockingStylesheetsLoaded()); 5656 (haveImportsLoaded() && haveRenderBlockingStylesheetsLoaded());
(...skipping 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after
6669 } 6670 }
6670 6671
6671 void showLiveDocumentInstances() { 6672 void showLiveDocumentInstances() {
6672 WeakDocumentSet& set = liveDocumentSet(); 6673 WeakDocumentSet& set = liveDocumentSet();
6673 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6674 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6674 for (blink::Document* document : set) 6675 for (blink::Document* document : set)
6675 fprintf(stderr, "- Document %p URL: %s\n", document, 6676 fprintf(stderr, "- Document %p URL: %s\n", document,
6676 document->url().getString().utf8().data()); 6677 document->url().getString().utf8().data());
6677 } 6678 }
6678 #endif 6679 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698