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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 } | 241 } |
242 | 242 |
243 loadShadowPage(); | 243 loadShadowPage(); |
244 } | 244 } |
245 | 245 |
246 void WebEmbeddedWorkerImpl::loadShadowPage() | 246 void WebEmbeddedWorkerImpl::loadShadowPage() |
247 { | 247 { |
248 // Construct substitute data source for the 'shadow page'. We only need it | 248 // Construct substitute data source for the 'shadow page'. We only need it |
249 // to have same origin as the worker so the loading checks work correctly. | 249 // to have same origin as the worker so the loading checks work correctly. |
250 CString content(""); | 250 CString content(""); |
251 int length = static_cast<int>(content.length()); | 251 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), content.len
gth())); |
252 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), length)); | |
253 m_loadingShadowPage = true; | 252 m_loadingShadowPage = true; |
254 m_mainFrame->frame()->loader().load(FrameLoadRequest(0, ResourceRequest(m_wo
rkerStartData.scriptURL), SubstituteData(buffer, "text/html", "UTF-8", KURL())))
; | 253 m_mainFrame->frame()->loader().load(FrameLoadRequest(0, ResourceRequest(m_wo
rkerStartData.scriptURL), SubstituteData(buffer, "text/html", "UTF-8", KURL())))
; |
255 } | 254 } |
256 | 255 |
257 void WebEmbeddedWorkerImpl::willSendRequest( | 256 void WebEmbeddedWorkerImpl::willSendRequest( |
258 WebLocalFrame* frame, unsigned, WebURLRequest& request, | 257 WebLocalFrame* frame, unsigned, WebURLRequest& request, |
259 const WebURLResponse& redirectResponse) | 258 const WebURLResponse& redirectResponse) |
260 { | 259 { |
261 if (m_networkProvider) | 260 if (m_networkProvider) |
262 m_networkProvider->willSendRequest(frame->dataSource(), request); | 261 m_networkProvider->willSendRequest(frame->dataSource(), request); |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 m_mainScriptLoader.clear(); | 356 m_mainScriptLoader.clear(); |
358 | 357 |
359 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); | 358 m_workerGlobalScopeProxy = ServiceWorkerGlobalScopeProxy::create(*this, *doc
ument, *m_workerContextClient); |
360 m_loaderProxy = WorkerLoaderProxy::create(this); | 359 m_loaderProxy = WorkerLoaderProxy::create(this); |
361 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy); | 360 m_workerThread = ServiceWorkerThread::create(m_loaderProxy, *m_workerGlobalS
copeProxy); |
362 m_workerThread->start(startupData.release()); | 361 m_workerThread->start(startupData.release()); |
363 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); | 362 m_workerInspectorProxy->workerThreadCreated(document, m_workerThread.get(),
scriptURL); |
364 } | 363 } |
365 | 364 |
366 } // namespace blink | 365 } // namespace blink |
OLD | NEW |