OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 26 matching lines...) Expand all Loading... | |
37 #include "WebFrameClient.h" | 37 #include "WebFrameClient.h" |
38 | 38 |
39 namespace WebCore { | 39 namespace WebCore { |
40 class WorkerScriptLoader; | 40 class WorkerScriptLoader; |
41 class WorkerThread; | 41 class WorkerThread; |
42 } | 42 } |
43 | 43 |
44 namespace blink { | 44 namespace blink { |
45 | 45 |
46 class ServiceWorkerGlobalScopeProxy; | 46 class ServiceWorkerGlobalScopeProxy; |
47 class WebDataSource; | |
kinuko
2014/03/14 11:47:17
not necessary?
michaeln
2014/03/15 01:22:39
Done.
| |
48 class WebServiceWorkerNetworkProvider; | |
47 class WebView; | 49 class WebView; |
48 | 50 |
49 class WebEmbeddedWorkerImpl FINAL : | 51 class WebEmbeddedWorkerImpl FINAL : |
50 public WebEmbeddedWorker, | 52 public WebEmbeddedWorker, |
51 public WebFrameClient { | 53 public WebFrameClient { |
52 WTF_MAKE_NONCOPYABLE(WebEmbeddedWorkerImpl); | 54 WTF_MAKE_NONCOPYABLE(WebEmbeddedWorkerImpl); |
53 public: | 55 public: |
54 WebEmbeddedWorkerImpl( | 56 WebEmbeddedWorkerImpl( |
55 PassOwnPtr<WebServiceWorkerContextClient>, | 57 PassOwnPtr<WebServiceWorkerContextClient>, |
56 PassOwnPtr<WebWorkerPermissionClientProxy>); | 58 PassOwnPtr<WebWorkerPermissionClientProxy>); |
57 virtual ~WebEmbeddedWorkerImpl(); | 59 virtual ~WebEmbeddedWorkerImpl(); |
58 | 60 |
59 // WebEmbeddedWorker overrides. | 61 // WebEmbeddedWorker overrides. |
60 virtual void startWorkerContext(const WebEmbeddedWorkerStartData&) OVERRIDE; | 62 virtual void startWorkerContext(const WebEmbeddedWorkerStartData&) OVERRIDE; |
61 virtual void terminateWorkerContext() OVERRIDE; | 63 virtual void terminateWorkerContext() OVERRIDE; |
62 | 64 |
63 private: | 65 private: |
64 class Loader; | 66 class Loader; |
65 class LoaderProxy; | 67 class LoaderProxy; |
66 | 68 |
67 void prepareShadowPageForLoader(); | 69 void prepareShadowPageForLoader(); |
68 | 70 |
69 // WebFrameClient overrides. | 71 // WebFrameClient overrides. |
72 virtual void willSendRequest( | |
73 WebFrame*, unsigned identifier, WebURLRequest&, | |
74 const WebURLResponse& redirectResponse) OVERRIDE; | |
70 virtual void didFinishDocumentLoad(WebFrame*) OVERRIDE; | 75 virtual void didFinishDocumentLoad(WebFrame*) OVERRIDE; |
71 | 76 |
72 void onScriptLoaderFinished(); | 77 void onScriptLoaderFinished(); |
73 | 78 |
74 WebEmbeddedWorkerStartData m_workerStartData; | 79 WebEmbeddedWorkerStartData m_workerStartData; |
75 | 80 |
76 // These are kept until startWorkerContext is called, and then passed on | 81 // These are kept until startWorkerContext is called, and then passed on |
77 // to WorkerContext. | 82 // to WorkerContext. |
78 OwnPtr<WebServiceWorkerContextClient> m_workerContextClient; | 83 OwnPtr<WebServiceWorkerContextClient> m_workerContextClient; |
79 OwnPtr<WebWorkerPermissionClientProxy> m_permissionClient; | 84 OwnPtr<WebWorkerPermissionClientProxy> m_permissionClient; |
80 | 85 |
86 // We retain ownership of this one which is for use on the | |
87 // main thread only. | |
88 OwnPtr<WebServiceWorkerNetworkProvider> m_networkProvider; | |
89 | |
81 // Kept around only while main script loading is ongoing. | 90 // Kept around only while main script loading is ongoing. |
82 OwnPtr<Loader> m_mainScriptLoader; | 91 OwnPtr<Loader> m_mainScriptLoader; |
83 | 92 |
84 RefPtr<WebCore::WorkerThread> m_workerThread; | 93 RefPtr<WebCore::WorkerThread> m_workerThread; |
85 OwnPtr<LoaderProxy> m_loaderProxy; | 94 OwnPtr<LoaderProxy> m_loaderProxy; |
86 OwnPtr<ServiceWorkerGlobalScopeProxy> m_workerGlobalScopeProxy; | 95 OwnPtr<ServiceWorkerGlobalScopeProxy> m_workerGlobalScopeProxy; |
87 | 96 |
88 // 'shadow page' - created to proxy loading requests from the worker. | 97 // 'shadow page' - created to proxy loading requests from the worker. |
89 // Both WebView and WebFrame objects are close()'ed (where they're | 98 // Both WebView and WebFrame objects are close()'ed (where they're |
90 // deref'ed) when this EmbeddedWorkerImpl is destructed, therefore they | 99 // deref'ed) when this EmbeddedWorkerImpl is destructed, therefore they |
91 // are guaranteed to exist while this object is around. | 100 // are guaranteed to exist while this object is around. |
92 WebView* m_webView; | 101 WebView* m_webView; |
93 WebFrame* m_mainFrame; | 102 WebFrame* m_mainFrame; |
94 | 103 |
95 bool m_askedToTerminate; | 104 bool m_askedToTerminate; |
96 }; | 105 }; |
97 | 106 |
98 } // namespace blink | 107 } // namespace blink |
99 | 108 |
100 #endif // WebEmbeddedWorkerImpl_h | 109 #endif // WebEmbeddedWorkerImpl_h |
OLD | NEW |