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

Side by Side Diff: content/browser/worker_host/worker_process_host.h

Issue 115713004: Move the worker script loading code to the worker process (phase:2/5) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ 5 #ifndef CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_
6 #define CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ 6 #define CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_
7 7
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "content/browser/worker_host/worker_document_set.h" 15 #include "content/browser/worker_host/worker_document_set.h"
16 #include "content/browser/worker_host/worker_storage_partition.h" 16 #include "content/browser/worker_host/worker_storage_partition.h"
17 #include "content/common/content_export.h" 17 #include "content/common/content_export.h"
18 #include "content/public/browser/browser_child_process_host_delegate.h" 18 #include "content/public/browser/browser_child_process_host_delegate.h"
19 #include "content/public/browser/browser_child_process_host_iterator.h" 19 #include "content/public/browser/browser_child_process_host_iterator.h"
20 #include "content/public/common/process_type.h" 20 #include "content/public/common/process_type.h"
21 #include "ipc/ipc_sender.h" 21 #include "ipc/ipc_sender.h"
22 #include "url/gurl.h" 22 #include "url/gurl.h"
23 #include "webkit/common/resource_type.h" 23 #include "webkit/common/resource_type.h"
24 24
25 struct ResourceHostMsg_Request; 25 struct ResourceHostMsg_Request;
26 26
27 namespace blink{
28 enum WebContentSecurityPolicyType;
29 }
30
27 namespace fileapi { 31 namespace fileapi {
28 class FileSystemContext; 32 class FileSystemContext;
29 } // namespace fileapi 33 } // namespace fileapi
30 34
31 namespace net { 35 namespace net {
32 class URLRequestContext; 36 class URLRequestContext;
33 } 37 }
34 38
35 namespace webkit_database { 39 namespace webkit_database {
36 class DatabaseTracker; 40 class DatabaseTracker;
(...skipping 14 matching lines...) Expand all
51 // BrowserContext. 55 // BrowserContext.
52 class WorkerProcessHost : public BrowserChildProcessHostDelegate, 56 class WorkerProcessHost : public BrowserChildProcessHostDelegate,
53 public IPC::Sender { 57 public IPC::Sender {
54 public: 58 public:
55 // Contains information about each worker instance, needed to forward messages 59 // Contains information about each worker instance, needed to forward messages
56 // between the renderer and worker processes. 60 // between the renderer and worker processes.
57 class WorkerInstance { 61 class WorkerInstance {
58 public: 62 public:
59 WorkerInstance(const GURL& url, 63 WorkerInstance(const GURL& url,
60 const base::string16& name, 64 const base::string16& name,
65 const base::string16& content_security_policy,
66 blink::WebContentSecurityPolicyType security_policy_type,
61 int worker_route_id, 67 int worker_route_id,
62 int parent_process_id, 68 int parent_process_id,
63 int64 main_resource_appcache_id, 69 int64 main_resource_appcache_id,
64 ResourceContext* resource_context, 70 ResourceContext* resource_context,
65 const WorkerStoragePartition& partition); 71 const WorkerStoragePartition& partition);
66 // Used for pending instances. Rest of the parameters are ignored. 72 // Used for pending instances. Rest of the parameters are ignored.
67 WorkerInstance(const GURL& url, 73 WorkerInstance(const GURL& url,
68 bool shared, 74 bool shared,
69 const base::string16& name, 75 const base::string16& name,
70 ResourceContext* resource_context, 76 ResourceContext* resource_context,
(...skipping 30 matching lines...) Expand all
101 // is the only reference) as a result. 107 // is the only reference) as a result.
102 void ShareDocumentSet(const WorkerInstance& instance) { 108 void ShareDocumentSet(const WorkerInstance& instance) {
103 worker_document_set_ = instance.worker_document_set_; 109 worker_document_set_ = instance.worker_document_set_;
104 }; 110 };
105 111
106 // Accessors 112 // Accessors
107 bool closed() const { return closed_; } 113 bool closed() const { return closed_; }
108 void set_closed(bool closed) { closed_ = closed; } 114 void set_closed(bool closed) { closed_ = closed; }
109 const GURL& url() const { return url_; } 115 const GURL& url() const { return url_; }
110 const base::string16 name() const { return name_; } 116 const base::string16 name() const { return name_; }
117 const base::string16 content_security_policy() const {
118 return content_security_policy_;
119 }
120 blink::WebContentSecurityPolicyType security_policy_type() const {
121 return security_policy_type_;
122 }
111 int worker_route_id() const { return worker_route_id_; } 123 int worker_route_id() const { return worker_route_id_; }
112 int parent_process_id() const { return parent_process_id_; } 124 int parent_process_id() const { return parent_process_id_; }
113 int64 main_resource_appcache_id() const { 125 int64 main_resource_appcache_id() const {
114 return main_resource_appcache_id_; 126 return main_resource_appcache_id_;
115 } 127 }
116 WorkerDocumentSet* worker_document_set() const { 128 WorkerDocumentSet* worker_document_set() const {
117 return worker_document_set_.get(); 129 return worker_document_set_.get();
118 } 130 }
119 ResourceContext* resource_context() const { 131 ResourceContext* resource_context() const {
120 return resource_context_; 132 return resource_context_;
121 } 133 }
122 const WorkerStoragePartition& partition() const { 134 const WorkerStoragePartition& partition() const {
123 return partition_; 135 return partition_;
124 } 136 }
125 137
126 private: 138 private:
127 // Set of all filters (clients) associated with this worker. 139 // Set of all filters (clients) associated with this worker.
128 GURL url_; 140 GURL url_;
129 bool closed_; 141 bool closed_;
130 base::string16 name_; 142 base::string16 name_;
143 base::string16 content_security_policy_;
144 blink::WebContentSecurityPolicyType security_policy_type_;
131 int worker_route_id_; 145 int worker_route_id_;
132 int parent_process_id_; 146 int parent_process_id_;
133 int64 main_resource_appcache_id_; 147 int64 main_resource_appcache_id_;
134 FilterList filters_; 148 FilterList filters_;
135 scoped_refptr<WorkerDocumentSet> worker_document_set_; 149 scoped_refptr<WorkerDocumentSet> worker_document_set_;
136 ResourceContext* const resource_context_; 150 ResourceContext* const resource_context_;
137 WorkerStoragePartition partition_; 151 WorkerStoragePartition partition_;
138 }; 152 };
139 153
140 WorkerProcessHost(ResourceContext* resource_context, 154 WorkerProcessHost(ResourceContext* resource_context,
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 public: 269 public:
256 WorkerProcessHostIterator() 270 WorkerProcessHostIterator()
257 : BrowserChildProcessHostTypeIterator<WorkerProcessHost>( 271 : BrowserChildProcessHostTypeIterator<WorkerProcessHost>(
258 PROCESS_TYPE_WORKER) { 272 PROCESS_TYPE_WORKER) {
259 } 273 }
260 }; 274 };
261 275
262 } // namespace content 276 } // namespace content
263 277
264 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_ 278 #endif // CONTENT_BROWSER_WORKER_HOST_WORKER_PROCESS_HOST_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/worker_host/worker_process_host.cc » ('j') | content/worker/websharedworker_stub.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698