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

Side by Side Diff: third_party/WebKit/WebCore/dom/WorkerContext.h

Issue 20076: WebKit merge 40500:40539 [WebKit side] (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 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 23 matching lines...) Expand all
34 #include "EventTarget.h" 34 #include "EventTarget.h"
35 #include "ScriptExecutionContext.h" 35 #include "ScriptExecutionContext.h"
36 #include "WorkerScriptController.h" 36 #include "WorkerScriptController.h"
37 #include <wtf/OwnPtr.h> 37 #include <wtf/OwnPtr.h>
38 #include <wtf/PassRefPtr.h> 38 #include <wtf/PassRefPtr.h>
39 #include <wtf/RefCounted.h> 39 #include <wtf/RefCounted.h>
40 #include <wtf/RefPtr.h> 40 #include <wtf/RefPtr.h>
41 41
42 namespace WebCore { 42 namespace WebCore {
43 43
44 class ScheduledAction;
44 class WorkerLocation; 45 class WorkerLocation;
45 class WorkerNavigator; 46 class WorkerNavigator;
46 class WorkerThread; 47 class WorkerThread;
47 48
48 class WorkerContext : public RefCounted<WorkerContext>, public ScriptExecuti onContext, public EventTarget { 49 class WorkerContext : public RefCounted<WorkerContext>, public ScriptExecuti onContext, public EventTarget {
49 public: 50 public:
50 static PassRefPtr<WorkerContext> create(const KURL& url, const String& u serAgent, WorkerThread* thread) 51 static PassRefPtr<WorkerContext> create(const KURL& url, const String& u serAgent, WorkerThread* thread)
51 { 52 {
52 return adoptRef(new WorkerContext(url, userAgent, thread)); 53 return adoptRef(new WorkerContext(url, userAgent, thread));
53 } 54 }
(...skipping 17 matching lines...) Expand all
71 bool hasPendingActivity() const; 72 bool hasPendingActivity() const;
72 73
73 virtual void reportException(const String& errorMessage, int lineNumber, const String& sourceURL); 74 virtual void reportException(const String& errorMessage, int lineNumber, const String& sourceURL);
74 virtual void addMessage(MessageDestination, MessageSource, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL); 75 virtual void addMessage(MessageDestination, MessageSource, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL);
75 virtual void resourceRetrievedByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString); 76 virtual void resourceRetrievedByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString);
76 77
77 virtual WorkerContext* toWorkerContext() { return this; } 78 virtual WorkerContext* toWorkerContext() { return this; }
78 79
79 void postMessage(const String& message); 80 void postMessage(const String& message);
80 virtual void postTask(PassRefPtr<Task>); // Executes the task on context 's thread asynchronously. 81 virtual void postTask(PassRefPtr<Task>); // Executes the task on context 's thread asynchronously.
81 void postTaskToParentContext(PassRefPtr<Task>); // Executes the task in the parent's context (and thread) asynchronously. 82 void postTaskToWorkerObject(PassRefPtr<Task>); // Executes the task on t he worker object's thread asynchronously.
83
84 int installTimeout(ScheduledAction*, int timeout, bool singleShot);
85 void removeTimeout(int timeoutId);
82 86
83 virtual void addEventListener(const AtomicString& eventType, PassRefPtr< EventListener>, bool useCapture); 87 virtual void addEventListener(const AtomicString& eventType, PassRefPtr< EventListener>, bool useCapture);
84 virtual void removeEventListener(const AtomicString& eventType, EventLis tener*, bool useCapture); 88 virtual void removeEventListener(const AtomicString& eventType, EventLis tener*, bool useCapture);
85 virtual bool dispatchEvent(PassRefPtr<Event>, ExceptionCode&); 89 virtual bool dispatchEvent(PassRefPtr<Event>, ExceptionCode&);
86 90
87 void setOnmessage(PassRefPtr<EventListener> eventListener) { m_onmessage Listener = eventListener; } 91 void setOnmessage(PassRefPtr<EventListener> eventListener) { m_onmessage Listener = eventListener; }
88 EventListener* onmessage() const { return m_onmessageListener.get(); } 92 EventListener* onmessage() const { return m_onmessageListener.get(); }
89 93
90 typedef Vector<RefPtr<EventListener> > ListenerVector; 94 typedef Vector<RefPtr<EventListener> > ListenerVector;
91 typedef HashMap<AtomicString, ListenerVector> EventListenersMap; 95 typedef HashMap<AtomicString, ListenerVector> EventListenersMap;
(...skipping 26 matching lines...) Expand all
118 }; 122 };
119 123
120 } // namespace WebCore 124 } // namespace WebCore
121 125
122 #endif // ENABLE(WORKERS) 126 #endif // ENABLE(WORKERS)
123 127
124 #endif // WorkerContext_h 128 #endif // WorkerContext_h
125 129
126 130
127 131
OLDNEW
« no previous file with comments | « third_party/WebKit/WebCore/dom/Worker.cpp ('k') | third_party/WebKit/WebCore/dom/WorkerContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698