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 25 matching lines...) Expand all Loading... |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 class WebContentSettingsClient; | 38 class WebContentSettingsClient; |
39 class WebServiceWorkerContextClient; | 39 class WebServiceWorkerContextClient; |
40 class WebString; | 40 class WebString; |
41 struct WebConsoleMessage; | 41 struct WebConsoleMessage; |
42 struct WebEmbeddedWorkerStartData; | 42 struct WebEmbeddedWorkerStartData; |
43 | 43 |
44 // An interface to start and terminate an embedded worker. | 44 // An interface to start and terminate an embedded worker. |
45 // All methods of this class must be called on the main thread. | 45 // All methods of this class must be called on the main thread. |
46 class WebEmbeddedWorker { | 46 class BLINK_EXPORT WebEmbeddedWorker { |
47 public: | 47 public: |
48 // Invoked on the main thread to instantiate a WebEmbeddedWorker. | 48 // Invoked on the main thread to instantiate a WebEmbeddedWorker. |
49 // The given WebWorkerContextClient and WebContentSettingsClient are going to | 49 // The given WebWorkerContextClient and WebContentSettingsClient are going to |
50 // be passed on to the worker thread and is held by a newly created | 50 // be passed on to the worker thread and is held by a newly created |
51 // WorkerGlobalScope. | 51 // WorkerGlobalScope. |
52 BLINK_EXPORT static WebEmbeddedWorker* Create(WebServiceWorkerContextClient*, | 52 static WebEmbeddedWorker* Create(WebServiceWorkerContextClient*, |
53 WebContentSettingsClient*); | 53 WebContentSettingsClient*); |
54 | 54 |
55 virtual ~WebEmbeddedWorker() {} | 55 virtual ~WebEmbeddedWorker() {} |
56 | 56 |
57 // Starts and terminates WorkerThread and WorkerGlobalScope. | 57 // Starts and terminates WorkerThread and WorkerGlobalScope. |
58 virtual void StartWorkerContext(const WebEmbeddedWorkerStartData&) = 0; | 58 virtual void StartWorkerContext(const WebEmbeddedWorkerStartData&) = 0; |
59 virtual void TerminateWorkerContext() = 0; | 59 virtual void TerminateWorkerContext() = 0; |
60 | 60 |
61 // Resumes starting a worker startup that was paused via | 61 // Resumes starting a worker startup that was paused via |
62 // WebEmbeddedWorkerStartData.pauseAfterDownloadMode. | 62 // WebEmbeddedWorkerStartData.pauseAfterDownloadMode. |
63 virtual void ResumeAfterDownload() = 0; | 63 virtual void ResumeAfterDownload() = 0; |
64 | 64 |
65 // Inspector related methods. | 65 // Inspector related methods. |
66 virtual void AttachDevTools(const WebString& host_id, int session_id) = 0; | 66 virtual void AttachDevTools(const WebString& host_id, int session_id) = 0; |
67 virtual void ReattachDevTools(const WebString& host_id, | 67 virtual void ReattachDevTools(const WebString& host_id, |
68 int session_id, | 68 int session_id, |
69 const WebString& saved_state) = 0; | 69 const WebString& saved_state) = 0; |
70 virtual void DetachDevTools(int session_id) = 0; | 70 virtual void DetachDevTools(int session_id) = 0; |
71 virtual void DispatchDevToolsMessage(int session_id, | 71 virtual void DispatchDevToolsMessage(int session_id, |
72 int call_id, | 72 int call_id, |
73 const WebString& method, | 73 const WebString& method, |
74 const WebString& message) = 0; | 74 const WebString& message) = 0; |
75 virtual void AddMessageToConsole(const WebConsoleMessage&) = 0; | 75 virtual void AddMessageToConsole(const WebConsoleMessage&) = 0; |
76 }; | 76 }; |
77 | 77 |
78 } // namespace blink | 78 } // namespace blink |
79 | 79 |
80 #endif // WebEmbeddedWorker_h | 80 #endif // WebEmbeddedWorker_h |
OLD | NEW |