OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 21 matching lines...) Expand all Loading... |
32 #define WorkerObjectProxy_h | 32 #define WorkerObjectProxy_h |
33 | 33 |
34 #include "core/dom/MessagePort.h" | 34 #include "core/dom/MessagePort.h" |
35 #include "core/workers/WorkerReportingProxy.h" | 35 #include "core/workers/WorkerReportingProxy.h" |
36 #include "wtf/PassOwnPtr.h" | 36 #include "wtf/PassOwnPtr.h" |
37 #include "wtf/PassRefPtr.h" | 37 #include "wtf/PassRefPtr.h" |
38 | 38 |
39 namespace WebCore { | 39 namespace WebCore { |
40 | 40 |
41 class ExecutionContext; | 41 class ExecutionContext; |
| 42 class ExecutionContextTask; |
42 class WorkerMessagingProxy; | 43 class WorkerMessagingProxy; |
43 | 44 |
44 // A proxy to talk to the worker object. This object is created on the | 45 // A proxy to talk to the worker object. This object is created on the |
45 // worker object thread (i.e. usually the main thread), passed on to | 46 // worker object thread (i.e. usually the main thread), passed on to |
46 // the worker thread, and used just to proxy messages to the | 47 // the worker thread, and used just to proxy messages to the |
47 // WorkerMessagingProxy on the worker object thread. | 48 // WorkerMessagingProxy on the worker object thread. |
48 // | 49 // |
49 // Used only by Dedicated Worker. | 50 // Used only by Dedicated Worker. |
50 class WorkerObjectProxy FINAL : public WorkerReportingProxy { | 51 class WorkerObjectProxy FINAL : public WorkerReportingProxy { |
51 public: | 52 public: |
52 static PassOwnPtr<WorkerObjectProxy> create(ExecutionContext*, WorkerMessagi
ngProxy*); | 53 static PassOwnPtr<WorkerObjectProxy> create(ExecutionContext*, WorkerMessagi
ngProxy*); |
53 virtual ~WorkerObjectProxy() { } | 54 virtual ~WorkerObjectProxy() { } |
54 | 55 |
55 void postMessageToWorkerObject(PassRefPtr<SerializedScriptValue>, PassOwnPtr
<MessagePortChannelArray>); | 56 void postMessageToWorkerObject(PassRefPtr<SerializedScriptValue>, PassOwnPtr
<MessagePortChannelArray>); |
56 | 57 void postTaskToMainExecutionContext(PassOwnPtr<ExecutionContextTask>); |
57 void confirmMessageFromWorkerObject(bool hasPendingActivity); | 58 void confirmMessageFromWorkerObject(bool hasPendingActivity); |
58 void reportPendingActivity(bool hasPendingActivity); | 59 void reportPendingActivity(bool hasPendingActivity); |
59 | 60 |
60 // WorkerReportingProxy overrides. | 61 // WorkerReportingProxy overrides. |
61 virtual void reportException(const String& errorMessage, int lineNumber, int
columnNumber, const String& sourceURL) OVERRIDE; | 62 virtual void reportException(const String& errorMessage, int lineNumber, int
columnNumber, const String& sourceURL) OVERRIDE; |
62 virtual void reportConsoleMessage(MessageSource, MessageLevel, const String&
message, int lineNumber, const String& sourceURL) OVERRIDE; | 63 virtual void reportConsoleMessage(MessageSource, MessageLevel, const String&
message, int lineNumber, const String& sourceURL) OVERRIDE; |
63 virtual void postMessageToPageInspector(const String&) OVERRIDE; | 64 virtual void postMessageToPageInspector(const String&) OVERRIDE; |
64 virtual void updateInspectorStateCookie(const String&) OVERRIDE; | 65 virtual void updateInspectorStateCookie(const String&) OVERRIDE; |
65 virtual void workerGlobalScopeStarted(WorkerGlobalScope*) OVERRIDE { } | 66 virtual void workerGlobalScopeStarted(WorkerGlobalScope*) OVERRIDE { } |
66 virtual void workerGlobalScopeClosed() OVERRIDE; | 67 virtual void workerGlobalScopeClosed() OVERRIDE; |
67 virtual void workerGlobalScopeDestroyed() OVERRIDE; | 68 virtual void workerGlobalScopeDestroyed() OVERRIDE; |
68 virtual void willDestroyWorkerGlobalScope() OVERRIDE { } | 69 virtual void willDestroyWorkerGlobalScope() OVERRIDE { } |
69 | 70 |
70 private: | 71 private: |
71 WorkerObjectProxy(ExecutionContext*, WorkerMessagingProxy*); | 72 WorkerObjectProxy(ExecutionContext*, WorkerMessagingProxy*); |
72 | 73 |
73 // These objects always outlive this proxy. | 74 // These objects always outlive this proxy. |
74 ExecutionContext* m_executionContext; | 75 ExecutionContext* m_executionContext; |
75 WorkerMessagingProxy* m_messagingProxy; | 76 WorkerMessagingProxy* m_messagingProxy; |
76 }; | 77 }; |
77 | 78 |
78 } // namespace WebCore | 79 } // namespace WebCore |
79 | 80 |
80 #endif // WorkerObjectProxy_h | 81 #endif // WorkerObjectProxy_h |
OLD | NEW |