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 20 matching lines...) Expand all Loading... |
31 #ifndef WorkerObjectProxy_h | 31 #ifndef WorkerObjectProxy_h |
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 blink { | 39 namespace blink { |
40 | 40 |
| 41 class ConsoleMessage; |
41 class ExecutionContext; | 42 class ExecutionContext; |
42 class ExecutionContextTask; | 43 class ExecutionContextTask; |
43 class WorkerMessagingProxy; | 44 class WorkerMessagingProxy; |
44 | 45 |
45 // A proxy to talk to the worker object. This object is created on the | 46 // A proxy to talk to the worker object. This object is created on the |
46 // worker object thread (i.e. usually the main thread), passed on to | 47 // worker object thread (i.e. usually the main thread), passed on to |
47 // the worker thread, and used just to proxy messages to the | 48 // the worker thread, and used just to proxy messages to the |
48 // WorkerMessagingProxy on the worker object thread. | 49 // WorkerMessagingProxy on the worker object thread. |
49 // | 50 // |
50 // Used only by Dedicated Worker. | 51 // Used only by Dedicated Worker. |
51 class WorkerObjectProxy FINAL : public WorkerReportingProxy { | 52 class WorkerObjectProxy FINAL : public WorkerReportingProxy { |
52 public: | 53 public: |
53 static PassOwnPtr<WorkerObjectProxy> create(ExecutionContext*, WorkerMessagi
ngProxy*); | 54 static PassOwnPtr<WorkerObjectProxy> create(ExecutionContext*, WorkerMessagi
ngProxy*); |
54 virtual ~WorkerObjectProxy() { } | 55 virtual ~WorkerObjectProxy() { } |
55 | 56 |
56 void postMessageToWorkerObject(PassRefPtr<SerializedScriptValue>, PassOwnPtr
<MessagePortChannelArray>); | 57 void postMessageToWorkerObject(PassRefPtr<SerializedScriptValue>, PassOwnPtr
<MessagePortChannelArray>); |
57 void postTaskToMainExecutionContext(PassOwnPtr<ExecutionContextTask>); | 58 void postTaskToMainExecutionContext(PassOwnPtr<ExecutionContextTask>); |
58 void confirmMessageFromWorkerObject(bool hasPendingActivity); | 59 void confirmMessageFromWorkerObject(bool hasPendingActivity); |
59 void reportPendingActivity(bool hasPendingActivity); | 60 void reportPendingActivity(bool hasPendingActivity); |
60 | 61 |
61 // WorkerReportingProxy overrides. | 62 // WorkerReportingProxy overrides. |
62 virtual void reportException(const String& errorMessage, int lineNumber, int
columnNumber, const String& sourceURL) OVERRIDE; | 63 virtual void reportException(const String& errorMessage, int lineNumber, int
columnNumber, const String& sourceURL) OVERRIDE; |
63 virtual void reportConsoleMessage(MessageSource, MessageLevel, const String&
message, int lineNumber, const String& sourceURL) OVERRIDE; | 64 virtual void reportConsoleMessage(PassRefPtr<ConsoleMessage>) OVERRIDE; |
64 virtual void postMessageToPageInspector(const String&) OVERRIDE; | 65 virtual void postMessageToPageInspector(const String&) OVERRIDE; |
65 virtual void updateInspectorStateCookie(const String&) OVERRIDE; | 66 virtual void updateInspectorStateCookie(const String&) OVERRIDE; |
66 virtual void workerGlobalScopeStarted(WorkerGlobalScope*) OVERRIDE { } | 67 virtual void workerGlobalScopeStarted(WorkerGlobalScope*) OVERRIDE { } |
67 virtual void workerGlobalScopeClosed() OVERRIDE; | 68 virtual void workerGlobalScopeClosed() OVERRIDE; |
68 virtual void workerGlobalScopeDestroyed() OVERRIDE; | 69 virtual void workerGlobalScopeDestroyed() OVERRIDE; |
69 virtual void willDestroyWorkerGlobalScope() OVERRIDE { } | 70 virtual void willDestroyWorkerGlobalScope() OVERRIDE { } |
70 | 71 |
71 private: | 72 private: |
72 WorkerObjectProxy(ExecutionContext*, WorkerMessagingProxy*); | 73 WorkerObjectProxy(ExecutionContext*, WorkerMessagingProxy*); |
73 | 74 |
74 // These objects always outlive this proxy. | 75 // These objects always outlive this proxy. |
75 ExecutionContext* m_executionContext; | 76 ExecutionContext* m_executionContext; |
76 WorkerMessagingProxy* m_messagingProxy; | 77 WorkerMessagingProxy* m_messagingProxy; |
77 }; | 78 }; |
78 | 79 |
79 } // namespace blink | 80 } // namespace blink |
80 | 81 |
81 #endif // WorkerObjectProxy_h | 82 #endif // WorkerObjectProxy_h |
OLD | NEW |