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

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

Issue 22564003: Refactoring: Get rid of isDocument() check in EventTarget. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Applied the rename. Created 7 years, 4 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 | « Source/core/dom/EventTarget.cpp ('k') | no next file » | 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 26 matching lines...) Expand all
37 #include "core/platform/LifecycleContext.h" 37 #include "core/platform/LifecycleContext.h"
38 #include "core/platform/Supplementable.h" 38 #include "core/platform/Supplementable.h"
39 #include "weborigin/KURL.h" 39 #include "weborigin/KURL.h"
40 #include "wtf/HashSet.h" 40 #include "wtf/HashSet.h"
41 #include "wtf/OwnPtr.h" 41 #include "wtf/OwnPtr.h"
42 #include "wtf/PassOwnPtr.h" 42 #include "wtf/PassOwnPtr.h"
43 43
44 namespace WebCore { 44 namespace WebCore {
45 45
46 class ContextLifecycleNotifier; 46 class ContextLifecycleNotifier;
47 class DOMWindow;
47 class DatabaseContext; 48 class DatabaseContext;
48 class EventListener; 49 class EventListener;
49 class EventQueue; 50 class EventQueue;
50 class EventTarget; 51 class EventTarget;
51 class MessagePort; 52 class MessagePort;
52 class PublicURLManager; 53 class PublicURLManager;
53 class ScriptCallStack; 54 class ScriptCallStack;
54 class ScriptState; 55 class ScriptState;
55 56
56 class ScriptExecutionContext : public LifecycleContext, public SecurityContext, public Supplementable<ScriptExecutionContext> { 57 class ScriptExecutionContext : public LifecycleContext, public SecurityContext, public Supplementable<ScriptExecutionContext> {
57 public: 58 public:
58 ScriptExecutionContext(); 59 ScriptExecutionContext();
59 virtual ~ScriptExecutionContext(); 60 virtual ~ScriptExecutionContext();
60 61
61 virtual bool isDocument() const { return false; } 62 virtual bool isDocument() const { return false; }
62 virtual bool isWorkerGlobalScope() const { return false; } 63 virtual bool isWorkerGlobalScope() const { return false; }
63 64
64 virtual bool isJSExecutionForbidden() const = 0; 65 virtual bool isJSExecutionForbidden() const = 0;
65 66
67 virtual DOMWindow* executingWindow() { return 0; }
68 virtual void userEventWasHandled() { }
69
66 const KURL& url() const { return virtualURL(); } 70 const KURL& url() const { return virtualURL(); }
67 KURL completeURL(const String& url) const { return virtualCompleteURL(url); } 71 KURL completeURL(const String& url) const { return virtualCompleteURL(url); }
68 72
69 virtual String userAgent(const KURL&) const = 0; 73 virtual String userAgent(const KURL&) const = 0;
70 74
71 virtual void disableEval(const String& errorMessage) = 0; 75 virtual void disableEval(const String& errorMessage) = 0;
72 76
73 bool shouldSanitizeScriptError(const String& sourceURL, AccessControlStatus) ; 77 bool shouldSanitizeScriptError(const String& sourceURL, AccessControlStatus) ;
74 void reportException(PassRefPtr<ErrorEvent>, PassRefPtr<ScriptCallStack>, Ac cessControlStatus); 78 void reportException(PassRefPtr<ErrorEvent>, PassRefPtr<ScriptCallStack>, Ac cessControlStatus);
75 79
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 194
191 // The location of this member is important; to make sure contextDestroyed() notification on 195 // The location of this member is important; to make sure contextDestroyed() notification on
192 // ScriptExecutionContext's members (notably m_timeouts) is called before th ey are destructed, 196 // ScriptExecutionContext's members (notably m_timeouts) is called before th ey are destructed,
193 // m_lifecycleNotifer should be placed *after* such members. 197 // m_lifecycleNotifer should be placed *after* such members.
194 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier; 198 OwnPtr<ContextLifecycleNotifier> m_lifecycleNotifier;
195 }; 199 };
196 200
197 } // namespace WebCore 201 } // namespace WebCore
198 202
199 #endif // ScriptExecutionContext_h 203 #endif // ScriptExecutionContext_h
OLDNEW
« no previous file with comments | « Source/core/dom/EventTarget.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698