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

Side by Side Diff: chrome/renderer/webworker_base.h

Issue 509016: Refactored code to allow associating workers with multiple renderers. (Closed)
Patch Set: Disabled overly-aggressive assertion in ResourceDispatcherHost. Created 10 years, 10 months 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
« no previous file with comments | « chrome/renderer/websharedworker_proxy.cc ('k') | chrome/renderer/webworker_base.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 CHROME_RENDERER_WEBWORKER_BASE_H_ 5 #ifndef CHROME_RENDERER_WEBWORKER_BASE_H_
6 #define CHROME_RENDERER_WEBWORKER_BASE_H_ 6 #define CHROME_RENDERER_WEBWORKER_BASE_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "ipc/ipc_channel.h" 11 #include "ipc/ipc_channel.h"
12 12
13 class ChildThread; 13 class ChildThread;
14 class GURL; 14 class GURL;
15 15
16 // WebWorkerBase is the common base class used by both WebWorkerProxy and 16 // WebWorkerBase is the common base class used by both WebWorkerProxy and
17 // WebSharedWorker. It contains logic to support starting up both dedicated 17 // WebSharedWorker. It contains logic to support starting up both dedicated
18 // and shared workers, and handling message queueing while waiting for the 18 // and shared workers, and handling message queueing while waiting for the
19 // worker process to start. 19 // worker process to start.
20 class WebWorkerBase : public IPC::Channel::Listener { 20 class WebWorkerBase : public IPC::Channel::Listener {
21 public: 21 public:
22 WebWorkerBase(ChildThread* child_thread, 22 WebWorkerBase(ChildThread* child_thread,
23 unsigned long long document_id,
23 int route_id, 24 int route_id,
24 int render_view_route_id); 25 int render_view_route_id);
25 26
26 virtual ~WebWorkerBase(); 27 virtual ~WebWorkerBase();
27 28
28 // Creates and initializes a new worker context. 29 // Creates and initializes a new worker context.
29 void CreateWorkerContext(const GURL& script_url, 30 void CreateWorkerContext(const GURL& script_url,
30 bool is_shared, 31 bool is_shared,
31 const string16& name, 32 const string16& name,
32 const string16& user_agent, 33 const string16& user_agent,
(...skipping 21 matching lines...) Expand all
54 // a map that maps between these renderer-side route IDs and worker-side 55 // a map that maps between these renderer-side route IDs and worker-side
55 // routing ids). 56 // routing ids).
56 int route_id_; 57 int route_id_;
57 58
58 // The routing id for the RenderView that created this worker. 59 // The routing id for the RenderView that created this worker.
59 int render_view_route_id_; 60 int render_view_route_id_;
60 61
61 ChildThread* child_thread_; 62 ChildThread* child_thread_;
62 63
63 private: 64 private:
65 // ID of our parent document (used to shutdown workers when the parent
66 // document is detached).
67 unsigned long long document_id_;
68
64 // Stores messages that were sent before the StartWorkerContext message. 69 // Stores messages that were sent before the StartWorkerContext message.
65 std::vector<IPC::Message*> queued_messages_; 70 std::vector<IPC::Message*> queued_messages_;
66 }; 71 };
67 72
68 #endif // CHROME_RENDERER_WEBWORKER_BASE_H_ 73 #endif // CHROME_RENDERER_WEBWORKER_BASE_H_
OLDNEW
« no previous file with comments | « chrome/renderer/websharedworker_proxy.cc ('k') | chrome/renderer/webworker_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698