| OLD | NEW |
| 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 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 | 8 |
| 9 #include "DedicatedWorkerContext.h" | 9 #include "DedicatedWorkerContext.h" |
| 10 #include "DedicatedWorkerThread.h" | 10 #include "DedicatedWorkerThread.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 | 134 |
| 135 void WebWorkerImpl::startWorkerContext(const WebURL& script_url, | 135 void WebWorkerImpl::startWorkerContext(const WebURL& script_url, |
| 136 const WebString& user_agent, | 136 const WebString& user_agent, |
| 137 const WebString& source_code) { | 137 const WebString& source_code) { |
| 138 // Create 'shadow page'. This page is never displayed, it is used to proxy the | 138 // Create 'shadow page'. This page is never displayed, it is used to proxy the |
| 139 // loading requests from the worker context to the rest of WebKit and Chromium | 139 // loading requests from the worker context to the rest of WebKit and Chromium |
| 140 // infrastructure. | 140 // infrastructure. |
| 141 DCHECK(!web_view_); | 141 DCHECK(!web_view_); |
| 142 web_view_ = WebView::Create(NULL); | 142 web_view_ = WebView::Create(NULL); |
| 143 WebPreferences().Apply(web_view_); | 143 WebPreferences().Apply(web_view_); |
| 144 web_view_->InitializeMainFrame(WorkerWebFrameClient::GetSharedInstance()); | 144 web_view_->initializeMainFrame(WorkerWebFrameClient::GetSharedInstance()); |
| 145 | 145 |
| 146 WebFrameImpl* web_frame = static_cast<WebFrameImpl*>(web_view_->mainFrame()); | 146 WebFrameImpl* web_frame = static_cast<WebFrameImpl*>(web_view_->mainFrame()); |
| 147 | 147 |
| 148 // Construct substitute data source for the 'shadow page'. We only need it | 148 // Construct substitute data source for the 'shadow page'. We only need it |
| 149 // to have same origin as the worker so the loading checks work correctly. | 149 // to have same origin as the worker so the loading checks work correctly. |
| 150 WebCore::CString content(""); | 150 WebCore::CString content(""); |
| 151 int len = static_cast<int>(content.length()); | 151 int len = static_cast<int>(content.length()); |
| 152 RefPtr<WebCore::SharedBuffer> buf( | 152 RefPtr<WebCore::SharedBuffer> buf( |
| 153 WebCore::SharedBuffer::create(content.data(), len)); | 153 WebCore::SharedBuffer::create(content.data(), len)); |
| 154 WebCore::SubstituteData subst_data(buf, | 154 WebCore::SubstituteData subst_data(buf, |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 | 379 |
| 380 namespace WebKit { | 380 namespace WebKit { |
| 381 | 381 |
| 382 WebWorker* WebWorker::create(WebWorkerClient* client) { | 382 WebWorker* WebWorker::create(WebWorkerClient* client) { |
| 383 return NULL; | 383 return NULL; |
| 384 } | 384 } |
| 385 | 385 |
| 386 } | 386 } |
| 387 | 387 |
| 388 #endif | 388 #endif |
| OLD | NEW |