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

Side by Side Diff: Source/core/dom/ExecutionContext.h

Issue 332993002: Replace ContentSecurityPolicy::client() with a method returning an ExecutionContext (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/core/dom/ExecutionContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2012 Google Inc. All Rights Reserved. 3 * Copyright (C) 2012 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 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 ContentSecurityPolicy* contentSecurityPolicy() const; 78 ContentSecurityPolicy* contentSecurityPolicy() const;
79 const KURL& url() const; 79 const KURL& url() const;
80 KURL completeURL(const String& url) const; 80 KURL completeURL(const String& url) const;
81 void disableEval(const String& errorMessage); 81 void disableEval(const String& errorMessage);
82 DOMWindow* executingWindow() const; 82 DOMWindow* executingWindow() const;
83 String userAgent(const KURL&) const; 83 String userAgent(const KURL&) const;
84 void postTask(PassOwnPtr<ExecutionContextTask>); 84 void postTask(PassOwnPtr<ExecutionContextTask>);
85 void postTask(const Closure&); 85 void postTask(const Closure&);
86 double timerAlignmentInterval() const; 86 double timerAlignmentInterval() const;
87 87
88 virtual void reportBlockedScriptExecutionToInspector(const String& directive Text) = 0;
89
90 virtual SecurityContext& securityContext() = 0;
91 KURL contextURL() const { return virtualURL(); }
92 KURL contextCompleteURL(const String& url) const { return virtualCompleteURL (url); }
93
88 bool shouldSanitizeScriptError(const String& sourceURL, AccessControlStatus) ; 94 bool shouldSanitizeScriptError(const String& sourceURL, AccessControlStatus) ;
89 void reportException(PassRefPtrWillBeRawPtr<ErrorEvent>, PassRefPtrWillBeRaw Ptr<ScriptCallStack>, AccessControlStatus); 95 void reportException(PassRefPtrWillBeRawPtr<ErrorEvent>, PassRefPtrWillBeRaw Ptr<ScriptCallStack>, AccessControlStatus);
90 96
91 void addConsoleMessage(MessageSource, MessageLevel, const String& message, c onst String& sourceURL, unsigned lineNumber); 97 void addConsoleMessage(MessageSource, MessageLevel, const String& message, c onst String& sourceURL, unsigned lineNumber);
92 void addConsoleMessage(MessageSource, MessageLevel, const String& message, S criptState* = 0); 98 void addConsoleMessage(MessageSource, MessageLevel, const String& message, S criptState* = 0);
93 99
94 PublicURLManager& publicURLManager(); 100 PublicURLManager& publicURLManager();
95 101
96 // Active objects are not garbage collected even if inaccessible, e.g. becau se their activity may result in callbacks being invoked. 102 // Active objects are not garbage collected even if inaccessible, e.g. becau se their activity may result in callbacks being invoked.
97 bool hasPendingActivity(); 103 bool hasPendingActivity();
(...skipping 27 matching lines...) Expand all
125 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; } 131 bool isSandboxed(SandboxFlags mask) const { return m_sandboxFlags & mask; }
126 void enforceSandboxFlags(SandboxFlags mask); 132 void enforceSandboxFlags(SandboxFlags mask);
127 133
128 PassOwnPtr<LifecycleNotifier<ExecutionContext> > createLifecycleNotifier(); 134 PassOwnPtr<LifecycleNotifier<ExecutionContext> > createLifecycleNotifier();
129 135
130 virtual EventQueue* eventQueue() const = 0; 136 virtual EventQueue* eventQueue() const = 0;
131 137
132 protected: 138 protected:
133 void setClient(ExecutionContextClient* client) { m_client = client; } 139 void setClient(ExecutionContextClient* client) { m_client = client; }
134 140
141 virtual const KURL& virtualURL() const = 0;
142 virtual KURL virtualCompleteURL(const String&) const = 0;
143
135 ContextLifecycleNotifier& lifecycleNotifier(); 144 ContextLifecycleNotifier& lifecycleNotifier();
136 145
137 private: 146 private:
138 friend class DOMTimer; // For installNewTimeout() and removeTimeoutByID() be low. 147 friend class DOMTimer; // For installNewTimeout() and removeTimeoutByID() be low.
139 148
140 bool dispatchErrorEvent(PassRefPtrWillBeRawPtr<ErrorEvent>, AccessControlSta tus); 149 bool dispatchErrorEvent(PassRefPtrWillBeRawPtr<ErrorEvent>, AccessControlSta tus);
141 150
142 #if !ENABLE(OILPAN) 151 #if !ENABLE(OILPAN)
143 virtual void refExecutionContext() = 0; 152 virtual void refExecutionContext() = 0;
144 virtual void derefExecutionContext() = 0; 153 virtual void derefExecutionContext() = 0;
(...skipping 22 matching lines...) Expand all
167 176
168 // The location of this member is important; to make sure contextDestroyed() notification on 177 // The location of this member is important; to make sure contextDestroyed() notification on
169 // ExecutionContext's members (notably m_timeouts) is called before they are destructed, 178 // ExecutionContext's members (notably m_timeouts) is called before they are destructed,
170 // m_lifecycleNotifer should be placed *after* such members. 179 // m_lifecycleNotifer should be placed *after* such members.
171 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier; 180 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier;
172 }; 181 };
173 182
174 } // namespace WebCore 183 } // namespace WebCore
175 184
176 #endif // ExecutionContext_h 185 #endif // ExecutionContext_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/dom/ExecutionContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698