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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 { | 308 { |
309 // Construct substitute data source for the 'shadow page'. We only need it | 309 // Construct substitute data source for the 'shadow page'. We only need it |
310 // to have same origin as the worker so the loading checks work correctly. | 310 // to have same origin as the worker so the loading checks work correctly. |
311 CString content(""); | 311 CString content(""); |
312 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), content.len
gth())); | 312 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), content.len
gth())); |
313 m_loadingShadowPage = true; | 313 m_loadingShadowPage = true; |
314 m_mainFrame->frame()->loader().load(FrameLoadRequest(0, ResourceRequest(m_wo
rkerStartData.scriptURL), SubstituteData(buffer, "text/html", "UTF-8", KURL())))
; | 314 m_mainFrame->frame()->loader().load(FrameLoadRequest(0, ResourceRequest(m_wo
rkerStartData.scriptURL), SubstituteData(buffer, "text/html", "UTF-8", KURL())))
; |
315 } | 315 } |
316 | 316 |
317 void WebEmbeddedWorkerImpl::willSendRequest( | 317 void WebEmbeddedWorkerImpl::willSendRequest( |
318 WebLocalFrame* frame, unsigned, WebURLRequest& request, | 318 WebLocalFrame* frame, WebURLRequest& request) |
319 const WebURLResponse& redirectResponse) | |
320 { | 319 { |
321 if (m_networkProvider) | 320 if (m_networkProvider) |
322 m_networkProvider->willSendRequest(frame->dataSource(), request); | 321 m_networkProvider->willSendRequest(frame->dataSource(), request); |
323 } | 322 } |
324 | 323 |
325 void WebEmbeddedWorkerImpl::didFinishDocumentLoad(WebLocalFrame* frame) | 324 void WebEmbeddedWorkerImpl::didFinishDocumentLoad(WebLocalFrame* frame) |
326 { | 325 { |
327 DCHECK(!m_mainScriptLoader); | 326 DCHECK(!m_mainScriptLoader); |
328 DCHECK(!m_networkProvider); | 327 DCHECK(!m_networkProvider); |
329 DCHECK(m_mainFrame); | 328 DCHECK(m_mainFrame); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 m_mainThreadTaskRunners = ParentFrameTaskRunners::create(nullptr); | 444 m_mainThreadTaskRunners = ParentFrameTaskRunners::create(nullptr); |
446 | 445 |
447 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); | 446 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); |
448 m_loaderProxy = WorkerLoaderProxy::create(this); | 447 m_loaderProxy = WorkerLoaderProxy::create(this); |
449 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy); | 448 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy); |
450 m_workerThread->start(std::move(startupData)); | 449 m_workerThread->start(std::move(startupData)); |
451 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); | 450 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); |
452 } | 451 } |
453 | 452 |
454 } // namespace blink | 453 } // namespace blink |
OLD | NEW |