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

Side by Side Diff: Source/core/workers/WorkerGlobalScope.h

Issue 1136883003: Expose Document::isPrivilegedContext from WebDocument (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « Source/core/testing/NullExecutionContext.cpp ('k') | Source/core/workers/WorkerGlobalScope.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, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 virtual PassOwnPtr<CachedMetadataHandler> createWorkerScriptCachedMetadataHa ndler(const KURL& scriptURL, const Vector<char>* metaData) { return nullptr; } 104 virtual PassOwnPtr<CachedMetadataHandler> createWorkerScriptCachedMetadataHa ndler(const KURL& scriptURL, const Vector<char>* metaData) { return nullptr; }
105 105
106 WorkerNavigator* navigator() const; 106 WorkerNavigator* navigator() const;
107 107
108 // ScriptWrappable 108 // ScriptWrappable
109 v8::Local<v8::Object> wrap(v8::Isolate*, v8::Local<v8::Object> creationConte xt) override final; 109 v8::Local<v8::Object> wrap(v8::Isolate*, v8::Local<v8::Object> creationConte xt) override final;
110 v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const WrapperTypeIn fo*, v8::Local<v8::Object> wrapper) override final; 110 v8::Local<v8::Object> associateWithWrapper(v8::Isolate*, const WrapperTypeIn fo*, v8::Local<v8::Object> wrapper) override final;
111 111
112 // ExecutionContextClient 112 // ExecutionContextClient
113 WorkerEventQueue* eventQueue() const override final; 113 WorkerEventQueue* eventQueue() const override final;
114 SecurityContext& securityContext() override final { return *this; } 114 const SecurityContext& securityContext() const override final { return *this ; }
115 115
116 bool isContextThread() const override final; 116 bool isContextThread() const override final;
117 bool isJSExecutionForbidden() const override final; 117 bool isJSExecutionForbidden() const override final;
118 118
119 double timerAlignmentInterval() const override final; 119 double timerAlignmentInterval() const override final;
120 DOMTimerCoordinator* timers() override final; 120 DOMTimerCoordinator* timers() override final;
121 121
122 WorkerInspectorController* workerInspectorController() { return m_workerInsp ectorController.get(); } 122 WorkerInspectorController* workerInspectorController() { return m_workerInsp ectorController.get(); }
123 123
124 bool isClosing() { return m_closing; } 124 bool isClosing() { return m_closing; }
125 125
126 double timeOrigin() const { return m_timeOrigin; } 126 double timeOrigin() const { return m_timeOrigin; }
127 127
128 WorkerClients* clients() { return m_workerClients.get(); } 128 WorkerClients* clients() { return m_workerClients.get(); }
129 129
130 using SecurityContext::securityOrigin; 130 using SecurityContext::securityOrigin;
131 using SecurityContext::contentSecurityPolicy; 131 using SecurityContext::contentSecurityPolicy;
132 132
133 void addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) override fina l; 133 void addConsoleMessage(PassRefPtrWillBeRawPtr<ConsoleMessage>) override fina l;
134 ConsoleMessageStorage* messageStorage(); 134 ConsoleMessageStorage* messageStorage();
135 135
136 void exceptionHandled(int exceptionId, bool isHandled); 136 void exceptionHandled(int exceptionId, bool isHandled);
137 137
138 virtual void scriptLoaded(size_t scriptSize, size_t cachedMetadataSize) { } 138 virtual void scriptLoaded(size_t scriptSize, size_t cachedMetadataSize) { }
139 139
140 bool isPrivilegedContext(String& errorMessage, const PrivilegeContextCheck = StandardPrivilegeCheck) override; 140 bool isPrivilegedContext(String& errorMessage, const PrivilegeContextCheck = StandardPrivilegeCheck) const override;
141 141
142 DECLARE_VIRTUAL_TRACE(); 142 DECLARE_VIRTUAL_TRACE();
143 143
144 protected: 144 protected:
145 WorkerGlobalScope(const KURL&, const String& userAgent, WorkerThread*, doubl e timeOrigin, const SecurityOrigin*, PassOwnPtrWillBeRawPtr<WorkerClients>); 145 WorkerGlobalScope(const KURL&, const String& userAgent, WorkerThread*, doubl e timeOrigin, const SecurityOrigin*, PassOwnPtrWillBeRawPtr<WorkerClients>);
146 void applyContentSecurityPolicyFromString(const String& contentSecurityPolic y, ContentSecurityPolicyHeaderType); 146 void applyContentSecurityPolicyFromString(const String& contentSecurityPolic y, ContentSecurityPolicyHeaderType);
147 147
148 void logExceptionToConsole(const String& errorMessage, int scriptId, const S tring& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<Scrip tCallStack>) override; 148 void logExceptionToConsole(const String& errorMessage, int scriptId, const S tring& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<Scrip tCallStack>) override;
149 void addMessageToWorkerConsole(PassRefPtrWillBeRawPtr<ConsoleMessage>); 149 void addMessageToWorkerConsole(PassRefPtrWillBeRawPtr<ConsoleMessage>);
150 void setV8CacheOptions(V8CacheOptions v8CacheOptions) { m_v8CacheOptions = v 8CacheOptions; } 150 void setV8CacheOptions(V8CacheOptions v8CacheOptions) { m_v8CacheOptions = v 8CacheOptions; }
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 unsigned long m_workerExceptionUniqueIdentifier; 199 unsigned long m_workerExceptionUniqueIdentifier;
200 WillBeHeapHashMap<unsigned long, RefPtrWillBeMember<ConsoleMessage>> m_pendi ngMessages; 200 WillBeHeapHashMap<unsigned long, RefPtrWillBeMember<ConsoleMessage>> m_pendi ngMessages;
201 }; 201 };
202 202
203 DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorke rGlobalScope(), context.isWorkerGlobalScope()); 203 DEFINE_TYPE_CASTS(WorkerGlobalScope, ExecutionContext, context, context->isWorke rGlobalScope(), context.isWorkerGlobalScope());
204 204
205 } // namespace blink 205 } // namespace blink
206 206
207 #endif // WorkerGlobalScope_h 207 #endif // WorkerGlobalScope_h
OLDNEW
« no previous file with comments | « Source/core/testing/NullExecutionContext.cpp ('k') | Source/core/workers/WorkerGlobalScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698