Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: public/web/WebServiceWorkerContextClient.h

Issue 78233002: Implement initial part of WebEmbeddedWorker (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: addressed comments Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « public/web/WebEmbeddedWorkerStartData.h ('k') | public/web/WebServiceWorkerContextProxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 22 matching lines...) Expand all
33 33
34 #include "WebWorkerPermissionClientProxy.h" 34 #include "WebWorkerPermissionClientProxy.h"
35 35
36 namespace blink { 36 namespace blink {
37 37
38 class WebString; 38 class WebString;
39 class WebServiceWorkerContextProxy; 39 class WebServiceWorkerContextProxy;
40 40
41 // This interface is implemented by the client. It is suppoed to be created 41 // This interface is implemented by the client. It is suppoed to be created
42 // on the main thread and then passed on to the worker thread to be owned 42 // on the main thread and then passed on to the worker thread to be owned
43 // by a newly created WorkerGlobalScope. All methods of this class are 43 // by a newly created WorkerGlobalScope. All methods of this class, except
44 // called on the worker thread. 44 // for workerContextFailedToStart(), are called on the worker thread.
45 class WebServiceWorkerContextClient { 45 class WebServiceWorkerContextClient {
46 public: 46 public:
47 virtual ~WebServiceWorkerContextClient() { }
48
47 // A new WorkerGlobalScope is created and started to run on the 49 // A new WorkerGlobalScope is created and started to run on the
48 // worker thread. 50 // worker thread.
49 // This also gives back a proxy to the client to talk to the 51 // This also gives back a proxy to the client to talk to the
50 // newly created WorkerGlobalScope. The proxy is held by WorkerGlobalScope 52 // newly created WorkerGlobalScope. The proxy is held by WorkerGlobalScope
51 // and should not be held by the caller. No proxy methods should be called 53 // and should not be held by the caller. No proxy methods should be called
52 // after workerContextDestroyed() is called. 54 // after workerContextDestroyed() is called.
53 virtual void workerContextStarted(WebServiceWorkerContextProxy*) { } 55 virtual void workerContextStarted(WebServiceWorkerContextProxy*) { }
54 56
55 // WorkerGlobalScope.close() is called.
56 virtual void workerContextClosed() { }
57
58 // WorkerGlobalScope is destroyed. The client should clear the 57 // WorkerGlobalScope is destroyed. The client should clear the
59 // WebServiceWorkerGlobalScopeProxy when this is called. 58 // WebServiceWorkerGlobalScopeProxy when this is called.
60 virtual void workerContextDestroyed() { } 59 virtual void workerContextDestroyed() { }
61 60
61 // Starting worker context is failed. This could happen when loading
62 // worker script fails, or is asked to terminated before the context starts.
63 // This is called on the main thread.
64 virtual void workerContextFailedToStart() { }
65
62 virtual void dispatchDevToolsMessage(const WebString&) { } 66 virtual void dispatchDevToolsMessage(const WebString&) { }
63 virtual void saveDevToolsAgentState(const WebString&) { } 67 virtual void saveDevToolsAgentState(const WebString&) { }
64 }; 68 };
65 69
66 } // namespace blink 70 } // namespace blink
67 71
68 #endif // WebWorkerContextClient_h 72 #endif // WebWorkerContextClient_h
OLDNEW
« no previous file with comments | « public/web/WebEmbeddedWorkerStartData.h ('k') | public/web/WebServiceWorkerContextProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698