OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // to have same origin as the worker so the loading checks work correctly. | 162 // to have same origin as the worker so the loading checks work correctly. |
163 CString content(""); | 163 CString content(""); |
164 RefPtr<SharedBuffer> buffer( | 164 RefPtr<SharedBuffer> buffer( |
165 SharedBuffer::create(content.data(), content.length())); | 165 SharedBuffer::create(content.data(), content.length())); |
166 m_mainFrame->frame()->loader().load( | 166 m_mainFrame->frame()->loader().load( |
167 FrameLoadRequest(0, ResourceRequest(m_url), | 167 FrameLoadRequest(0, ResourceRequest(m_url), |
168 SubstituteData(buffer, "text/html", "UTF-8", KURL()))); | 168 SubstituteData(buffer, "text/html", "UTF-8", KURL()))); |
169 } | 169 } |
170 | 170 |
171 void WebSharedWorkerImpl::didFinishDocumentLoad(WebLocalFrame* frame) { | 171 void WebSharedWorkerImpl::didFinishDocumentLoad(WebLocalFrame* frame) { |
| 172 DCHECK_EQ(frame, m_mainFrame); |
172 DCHECK(isMainThread()); | 173 DCHECK(isMainThread()); |
173 DCHECK(!m_loadingDocument); | 174 DCHECK(!m_loadingDocument); |
174 DCHECK(!m_mainScriptLoader); | 175 DCHECK(!m_mainScriptLoader); |
175 frame->dataSource()->setServiceWorkerNetworkProvider( | 176 frame->dataSource()->setServiceWorkerNetworkProvider( |
176 WTF::wrapUnique(m_client->createServiceWorkerNetworkProvider())); | 177 WTF::wrapUnique(m_client->createServiceWorkerNetworkProvider())); |
177 m_mainScriptLoader = WorkerScriptLoader::create(); | 178 m_mainScriptLoader = WorkerScriptLoader::create(); |
178 m_mainScriptLoader->setRequestContext( | 179 m_mainScriptLoader->setRequestContext( |
179 WebURLRequest::RequestContextSharedWorker); | 180 WebURLRequest::RequestContextSharedWorker); |
180 m_loadingDocument = toWebLocalFrameImpl(frame)->frame()->document(); | 181 m_loadingDocument = toWebLocalFrameImpl(frame)->frame()->document(); |
181 | 182 |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 if (devtoolsAgent) | 420 if (devtoolsAgent) |
420 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, | 421 devtoolsAgent->dispatchOnInspectorBackend(sessionId, callId, method, |
421 message); | 422 message); |
422 } | 423 } |
423 | 424 |
424 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) { | 425 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) { |
425 return new WebSharedWorkerImpl(client); | 426 return new WebSharedWorkerImpl(client); |
426 } | 427 } |
427 | 428 |
428 } // namespace blink | 429 } // namespace blink |
OLD | NEW |