OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "content/worker/websharedworker_stub.h" | 5 #include "content/worker/websharedworker_stub.h" |
6 | 6 |
7 #include "content/common/child_process.h" | 7 #include "content/common/child_process.h" |
8 #include "content/common/child_thread.h" | 8 #include "content/common/child_thread.h" |
9 #include "content/common/file_system/file_system_dispatcher.h" | 9 #include "content/common/file_system/file_system_dispatcher.h" |
10 #include "content/common/webmessageportchannel_impl.h" | 10 #include "content/common/webmessageportchannel_impl.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 | 74 |
75 void WebSharedWorkerStub::OnChannelError() { | 75 void WebSharedWorkerStub::OnChannelError() { |
76 OnTerminateWorkerContext(); | 76 OnTerminateWorkerContext(); |
77 } | 77 } |
78 | 78 |
79 const GURL& WebSharedWorkerStub::url() { | 79 const GURL& WebSharedWorkerStub::url() { |
80 return url_; | 80 return url_; |
81 } | 81 } |
82 | 82 |
83 void WebSharedWorkerStub::OnStartWorkerContext( | 83 void WebSharedWorkerStub::OnStartWorkerContext( |
84 const GURL& url, const string16& user_agent, const string16& source_code) { | 84 const GURL& url, const string16& user_agent, const string16& source_code, |
85 const string16& /* content_security_policy */, bool /* report_only */) { | |
85 // Ignore multiple attempts to start this worker (can happen if two pages | 86 // Ignore multiple attempts to start this worker (can happen if two pages |
86 // try to start it simultaneously). | 87 // try to start it simultaneously). |
87 if (started_) | 88 if (started_) |
88 return; | 89 return; |
89 | 90 |
91 // FIXME(tsepez): pass CSP info into worker once webkit interface updated. | |
abarth-chromium
2012/01/09 21:15:58
FIXME -> TODO
Tom Sepez
2012/01/09 21:18:19
Done.
| |
90 impl_->startWorkerContext(url, name_, user_agent, source_code, 0); | 92 impl_->startWorkerContext(url, name_, user_agent, source_code, 0); |
91 started_ = true; | 93 started_ = true; |
92 url_ = url; | 94 url_ = url; |
93 | 95 |
94 // Process any pending connections. | 96 // Process any pending connections. |
95 for (PendingConnectInfoList::const_iterator iter = pending_connects_.begin(); | 97 for (PendingConnectInfoList::const_iterator iter = pending_connects_.begin(); |
96 iter != pending_connects_.end(); | 98 iter != pending_connects_.end(); |
97 ++iter) { | 99 ++iter) { |
98 OnConnect(iter->first, iter->second); | 100 OnConnect(iter->first, iter->second); |
99 } | 101 } |
(...skipping 15 matching lines...) Expand all Loading... | |
115 } | 117 } |
116 } | 118 } |
117 | 119 |
118 void WebSharedWorkerStub::OnTerminateWorkerContext() { | 120 void WebSharedWorkerStub::OnTerminateWorkerContext() { |
119 impl_->terminateWorkerContext(); | 121 impl_->terminateWorkerContext(); |
120 | 122 |
121 // Call the client to make sure context exits. | 123 // Call the client to make sure context exits. |
122 EnsureWorkerContextTerminates(); | 124 EnsureWorkerContextTerminates(); |
123 started_ = false; | 125 started_ = false; |
124 } | 126 } |
OLD | NEW |