| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_WEB_WORKER_H_ | 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_WEB_WORKER_H_ |
| 6 #define WEBKIT_TOOLS_TEST_SHELL_TEST_WEB_WORKER_H_ | 6 #define WEBKIT_TOOLS_TEST_SHELL_TEST_WEB_WORKER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "third_party/WebKit/WebKit/chromium/public/WebMessagePortChannel.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebMessagePortChannel.h" |
| 11 #include "third_party/WebKit/WebKit/chromium/public/WebWorker.h" | 11 #include "third_party/WebKit/WebKit/chromium/public/WebWorker.h" |
| 12 #include "third_party/WebKit/WebKit/chromium/public/WebWorkerClient.h" | 12 #include "third_party/WebKit/WebKit/chromium/public/WebWorkerClient.h" |
| 13 | 13 |
| 14 namespace WebKit { | 14 namespace WebKit { |
| 15 class WebApplicationCacheHost; |
| 16 class WebApplicationCacheHostClient; |
| 15 class WebNotificationPresenter; | 17 class WebNotificationPresenter; |
| 16 class WebString; | 18 class WebString; |
| 17 class WebURL; | 19 class WebURL; |
| 18 } | 20 } |
| 19 | 21 |
| 22 // WebWorkers are not functional in test_shell. This class effectively |
| 23 // stubs things out. |
| 20 class TestWebWorker : public WebKit::WebWorker, | 24 class TestWebWorker : public WebKit::WebWorker, |
| 21 public WebKit::WebWorkerClient, | 25 public WebKit::WebWorkerClient, |
| 22 public base::RefCounted<TestWebWorker> { | 26 public base::RefCounted<TestWebWorker> { |
| 23 public: | 27 public: |
| 24 TestWebWorker() { | 28 TestWebWorker() { |
| 25 AddRef(); // Adds the reference held for worker object. | 29 AddRef(); // Adds the reference held for worker object. |
| 26 AddRef(); // Adds the reference held for worker context object. | 30 AddRef(); // Adds the reference held for worker context object. |
| 27 } | 31 } |
| 28 | 32 |
| 29 // WebWorker methods: | 33 // WebWorker methods: |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 virtual void workerContextClosed() { } | 71 virtual void workerContextClosed() { } |
| 68 virtual void workerContextDestroyed() { | 72 virtual void workerContextDestroyed() { |
| 69 Release(); // Releases the reference held for worker context object. | 73 Release(); // Releases the reference held for worker context object. |
| 70 } | 74 } |
| 71 virtual WebKit::WebWorker* createWorker(WebKit::WebWorkerClient* client) { | 75 virtual WebKit::WebWorker* createWorker(WebKit::WebWorkerClient* client) { |
| 72 return NULL; | 76 return NULL; |
| 73 } | 77 } |
| 74 virtual WebKit::WebNotificationPresenter* notificationPresenter() { | 78 virtual WebKit::WebNotificationPresenter* notificationPresenter() { |
| 75 return NULL; | 79 return NULL; |
| 76 } | 80 } |
| 81 virtual WebKit::WebApplicationCacheHost* createApplicationCacheHost( |
| 82 WebKit::WebApplicationCacheHostClient*) { |
| 83 return NULL; |
| 84 } |
| 77 | 85 |
| 78 private: | 86 private: |
| 79 friend class base::RefCounted<TestWebWorker>; | 87 friend class base::RefCounted<TestWebWorker>; |
| 80 | 88 |
| 81 ~TestWebWorker() {} | 89 ~TestWebWorker() {} |
| 82 | 90 |
| 83 DISALLOW_COPY_AND_ASSIGN(TestWebWorker); | 91 DISALLOW_COPY_AND_ASSIGN(TestWebWorker); |
| 84 }; | 92 }; |
| 85 | 93 |
| 86 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_WEB_WORKER_H_ | 94 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_WEB_WORKER_H_ |
| OLD | NEW |