| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 m_mainFrame = WebLocalFrame::create(this); | 274 m_mainFrame = WebLocalFrame::create(this); |
| 275 m_webView->setMainFrame(m_mainFrame); | 275 m_webView->setMainFrame(m_mainFrame); |
| 276 | 276 |
| 277 WebLocalFrameImpl* webFrame = toWebLocalFrameImpl(m_webView->mainFrame()); | 277 WebLocalFrameImpl* webFrame = toWebLocalFrameImpl(m_webView->mainFrame()); |
| 278 | 278 |
| 279 // Construct substitute data source for the 'shadow page'. We only need it | 279 // Construct substitute data source for the 'shadow page'. We only need it |
| 280 // to have same origin as the worker so the loading checks work correctly. | 280 // to have same origin as the worker so the loading checks work correctly. |
| 281 CString content(""); | 281 CString content(""); |
| 282 int length = static_cast<int>(content.length()); | 282 int length = static_cast<int>(content.length()); |
| 283 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), length)); | 283 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), length)); |
| 284 webFrame->frame()->loader().load(FrameLoadRequest(0, ResourceRequest(m_worke
rStartData.scriptURL), SubstituteData(buffer, "text/html", "UTF-8", KURL()))); | 284 ResourceRequest request = ResourceRequest(m_workerStartData.scriptURL, !webF
rame->parent()); |
| 285 webFrame->frame()->loader().load(FrameLoadRequest(0, request, SubstituteData
(buffer, "text/html", "UTF-8", KURL()))); |
| 285 } | 286 } |
| 286 | 287 |
| 287 void WebEmbeddedWorkerImpl::willSendRequest( | 288 void WebEmbeddedWorkerImpl::willSendRequest( |
| 288 WebLocalFrame* frame, unsigned, WebURLRequest& request, | 289 WebLocalFrame* frame, unsigned, WebURLRequest& request, |
| 289 const WebURLResponse& redirectResponse) | 290 const WebURLResponse& redirectResponse) |
| 290 { | 291 { |
| 291 if (m_networkProvider) | 292 if (m_networkProvider) |
| 292 m_networkProvider->willSendRequest(frame->dataSource(), request); | 293 m_networkProvider->willSendRequest(frame->dataSource(), request); |
| 293 } | 294 } |
| 294 | 295 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 m_mainScriptLoader.clear(); | 354 m_mainScriptLoader.clear(); |
| 354 | 355 |
| 355 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *toW
ebLocalFrameImpl(m_mainFrame)->frame()->document(), *m_workerContextClient); | 356 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *toW
ebLocalFrameImpl(m_mainFrame)->frame()->document(), *m_workerContextClient); |
| 356 m_loaderProxy = LoaderProxy::create(*this); | 357 m_loaderProxy = LoaderProxy::create(*this); |
| 357 | 358 |
| 358 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal
ScopeProxy, startupData.release()); | 359 m_workerThread = ServiceWorkerThread::create(*m_loaderProxy, *m_workerGlobal
ScopeProxy, startupData.release()); |
| 359 m_workerThread->start(); | 360 m_workerThread->start(); |
| 360 } | 361 } |
| 361 | 362 |
| 362 } // namespace blink | 363 } // namespace blink |
| OLD | NEW |