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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 class WebString; | 52 class WebString; |
53 class WebURL; | 53 class WebURL; |
54 class WebView; | 54 class WebView; |
55 class WebWorker; | 55 class WebWorker; |
56 class WebSharedWorkerClient; | 56 class WebSharedWorkerClient; |
57 | 57 |
58 // This class is used by the worker process code to talk to the WebCore::SharedW
orker implementation. | 58 // This class is used by the worker process code to talk to the WebCore::SharedW
orker implementation. |
59 // It can't use it directly since it uses WebKit types, so this class converts t
he data types. | 59 // It can't use it directly since it uses WebKit types, so this class converts t
he data types. |
60 // When the WebCore::SharedWorker object wants to call WebCore::WorkerReportingP
roxy, this class will | 60 // When the WebCore::SharedWorker object wants to call WebCore::WorkerReportingP
roxy, this class will |
61 // convert to Chrome data types first and then call the supplied WebCommonWorker
Client. | 61 // convert to Chrome data types first and then call the supplied WebCommonWorker
Client. |
62 class WebSharedWorkerImpl | 62 class WebSharedWorkerImpl FINAL |
63 : public WebCore::WorkerReportingProxy | 63 : public WebCore::WorkerReportingProxy |
64 , public WebCore::WorkerLoaderProxy | 64 , public WebCore::WorkerLoaderProxy |
65 , public WebFrameClient | 65 , public WebFrameClient |
66 , public WebSharedWorker { | 66 , public WebSharedWorker { |
67 public: | 67 public: |
68 explicit WebSharedWorkerImpl(WebSharedWorkerClient*); | 68 explicit WebSharedWorkerImpl(WebSharedWorkerClient*); |
69 | 69 |
70 // WebCore::WorkerReportingProxy methods: | 70 // WebCore::WorkerReportingProxy methods: |
71 virtual void reportException( | 71 virtual void reportException( |
72 const WTF::String&, int, int, const WTF::String&); | 72 const WTF::String&, int, int, const WTF::String&) OVERRIDE; |
73 virtual void reportConsoleMessage( | 73 virtual void reportConsoleMessage( |
74 WebCore::MessageSource, WebCore::MessageLevel, | 74 WebCore::MessageSource, WebCore::MessageLevel, |
75 const WTF::String&, int, const WTF::String&); | 75 const WTF::String&, int, const WTF::String&) OVERRIDE; |
76 virtual void postMessageToPageInspector(const WTF::String&); | 76 virtual void postMessageToPageInspector(const WTF::String&) OVERRIDE; |
77 virtual void updateInspectorStateCookie(const WTF::String&); | 77 virtual void updateInspectorStateCookie(const WTF::String&) OVERRIDE; |
78 virtual void workerGlobalScopeStarted(WebCore::WorkerGlobalScope*); | 78 virtual void workerGlobalScopeStarted(WebCore::WorkerGlobalScope*) OVERRIDE; |
79 virtual void workerGlobalScopeClosed(); | 79 virtual void workerGlobalScopeClosed() OVERRIDE; |
80 virtual void workerGlobalScopeDestroyed(); | 80 virtual void workerGlobalScopeDestroyed() OVERRIDE; |
81 | 81 |
82 // WebCore::WorkerLoaderProxy methods: | 82 // WebCore::WorkerLoaderProxy methods: |
83 virtual void postTaskToLoader(PassOwnPtr<WebCore::ExecutionContextTask>); | 83 virtual void postTaskToLoader(PassOwnPtr<WebCore::ExecutionContextTask>) OVE
RRIDE; |
84 virtual bool postTaskForModeToWorkerGlobalScope( | 84 virtual bool postTaskForModeToWorkerGlobalScope( |
85 PassOwnPtr<WebCore::ExecutionContextTask>, const WTF::String& mode); | 85 PassOwnPtr<WebCore::ExecutionContextTask>, const WTF::String& mode) OVER
RIDE; |
86 | 86 |
87 // WebFrameClient methods to support resource loading thru the 'shadow page'
. | 87 // WebFrameClient methods to support resource loading thru the 'shadow page'
. |
88 virtual WebApplicationCacheHost* createApplicationCacheHost(WebFrame*, WebAp
plicationCacheHostClient*); | 88 virtual WebApplicationCacheHost* createApplicationCacheHost(WebFrame*, WebAp
plicationCacheHostClient*) OVERRIDE; |
89 | 89 |
90 // WebSharedWorker methods: | 90 // WebSharedWorker methods: |
91 virtual void startWorkerContext(const WebURL&, const WebString& name, const
WebString& userAgent, const WebString& sourceCode, const WebString& contentSecur
ityPolicy, WebContentSecurityPolicyType, long long cacheId); | 91 virtual void startWorkerContext(const WebURL&, const WebString& name, const
WebString& userAgent, const WebString& sourceCode, const WebString& contentSecur
ityPolicy, WebContentSecurityPolicyType, long long cacheId) OVERRIDE; |
92 virtual void connect(WebMessagePortChannel*); | 92 virtual void connect(WebMessagePortChannel*) OVERRIDE; |
93 virtual void terminateWorkerContext(); | 93 virtual void terminateWorkerContext() OVERRIDE; |
94 virtual void clientDestroyed(); | 94 virtual void clientDestroyed() OVERRIDE; |
95 | 95 |
96 virtual void pauseWorkerContextOnStart(); | 96 virtual void pauseWorkerContextOnStart() OVERRIDE; |
97 virtual void resumeWorkerContext(); | 97 virtual void resumeWorkerContext() OVERRIDE; |
98 virtual void attachDevTools(); | 98 virtual void attachDevTools() OVERRIDE; |
99 virtual void reattachDevTools(const WebString& savedState); | 99 virtual void reattachDevTools(const WebString& savedState) OVERRIDE; |
100 virtual void detachDevTools(); | 100 virtual void detachDevTools() OVERRIDE; |
101 virtual void dispatchDevToolsMessage(const WebString&); | 101 virtual void dispatchDevToolsMessage(const WebString&) OVERRIDE; |
102 | 102 |
103 private: | 103 private: |
104 virtual ~WebSharedWorkerImpl(); | 104 virtual ~WebSharedWorkerImpl(); |
105 | 105 |
106 WebSharedWorkerClient* client() { return m_client->get(); } | 106 WebSharedWorkerClient* client() { return m_client->get(); } |
107 | 107 |
108 void setWorkerThread(PassRefPtr<WebCore::WorkerThread> thread) { m_workerThr
ead = thread; } | 108 void setWorkerThread(PassRefPtr<WebCore::WorkerThread> thread) { m_workerThr
ead = thread; } |
109 WebCore::WorkerThread* workerThread() { return m_workerThread.get(); } | 109 WebCore::WorkerThread* workerThread() { return m_workerThread.get(); } |
110 | 110 |
111 // Shuts down the worker thread. | 111 // Shuts down the worker thread. |
(...skipping 22 matching lines...) Expand all Loading... |
134 // class itself, but here it's implemented by Chrome so we create | 134 // class itself, but here it's implemented by Chrome so we create |
135 // our own WeakPtr. | 135 // our own WeakPtr. |
136 WeakPtr<WebSharedWorkerClient> m_clientWeakPtr; | 136 WeakPtr<WebSharedWorkerClient> m_clientWeakPtr; |
137 | 137 |
138 bool m_pauseWorkerContextOnStart; | 138 bool m_pauseWorkerContextOnStart; |
139 }; | 139 }; |
140 | 140 |
141 } // namespace blink | 141 } // namespace blink |
142 | 142 |
143 #endif | 143 #endif |
OLD | NEW |