| 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, |
| 86 WebKit::WebContentSecurityPolicyType policy_type) { |
| 85 // Ignore multiple attempts to start this worker (can happen if two pages | 87 // Ignore multiple attempts to start this worker (can happen if two pages |
| 86 // try to start it simultaneously). | 88 // try to start it simultaneously). |
| 87 if (started_) | 89 if (started_) |
| 88 return; | 90 return; |
| 89 | 91 |
| 90 impl_->startWorkerContext(url, name_, user_agent, source_code, 0); | 92 impl_->startWorkerContext(url, name_, user_agent, source_code, |
| 93 content_security_policy, policy_type, 0); |
| 91 started_ = true; | 94 started_ = true; |
| 92 url_ = url; | 95 url_ = url; |
| 93 | 96 |
| 94 // Process any pending connections. | 97 // Process any pending connections. |
| 95 for (PendingConnectInfoList::const_iterator iter = pending_connects_.begin(); | 98 for (PendingConnectInfoList::const_iterator iter = pending_connects_.begin(); |
| 96 iter != pending_connects_.end(); | 99 iter != pending_connects_.end(); |
| 97 ++iter) { | 100 ++iter) { |
| 98 OnConnect(iter->first, iter->second); | 101 OnConnect(iter->first, iter->second); |
| 99 } | 102 } |
| 100 pending_connects_.clear(); | 103 pending_connects_.clear(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 115 } | 118 } |
| 116 } | 119 } |
| 117 | 120 |
| 118 void WebSharedWorkerStub::OnTerminateWorkerContext() { | 121 void WebSharedWorkerStub::OnTerminateWorkerContext() { |
| 119 impl_->terminateWorkerContext(); | 122 impl_->terminateWorkerContext(); |
| 120 | 123 |
| 121 // Call the client to make sure context exits. | 124 // Call the client to make sure context exits. |
| 122 EnsureWorkerContextTerminates(); | 125 EnsureWorkerContextTerminates(); |
| 123 started_ = false; | 126 started_ = false; |
| 124 } | 127 } |
| OLD | NEW |