| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 WebFrameImpl* webFrame = toWebFrameImpl(m_webView->mainFrame()); | 198 WebFrameImpl* webFrame = toWebFrameImpl(m_webView->mainFrame()); |
| 199 | 199 |
| 200 // Construct substitute data source for the 'shadow page'. We only need it | 200 // Construct substitute data source for the 'shadow page'. We only need it |
| 201 // to have same origin as the worker so the loading checks work correctly. | 201 // to have same origin as the worker so the loading checks work correctly. |
| 202 CString content(""); | 202 CString content(""); |
| 203 int length = static_cast<int>(content.length()); | 203 int length = static_cast<int>(content.length()); |
| 204 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), length)); | 204 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), length)); |
| 205 webFrame->frame()->loader().load(FrameLoadRequest(0, ResourceRequest(url), S
ubstituteData(buffer, "text/html", "UTF-8", KURL()))); | 205 webFrame->frame()->loader().load(FrameLoadRequest(0, ResourceRequest(url), S
ubstituteData(buffer, "text/html", "UTF-8", KURL()))); |
| 206 } | 206 } |
| 207 | 207 |
| 208 WebApplicationCacheHost* WebSharedWorkerImpl::createApplicationCacheHost(WebFram
e*, WebApplicationCacheHostClient* appcacheHostClient) | 208 WebApplicationCacheHost* WebSharedWorkerImpl::createApplicationCacheHost(WebLoca
lFrame*, WebApplicationCacheHostClient* appcacheHostClient) |
| 209 { | 209 { |
| 210 if (client()) | 210 if (client()) |
| 211 return client()->createApplicationCacheHost(appcacheHostClient); | 211 return client()->createApplicationCacheHost(appcacheHostClient); |
| 212 return 0; | 212 return 0; |
| 213 } | 213 } |
| 214 | 214 |
| 215 void WebSharedWorkerImpl::didFinishDocumentLoad(WebFrame* frame) | 215 void WebSharedWorkerImpl::didFinishDocumentLoad(WebLocalFrame* frame) |
| 216 { | 216 { |
| 217 ASSERT(!m_loadingDocument); | 217 ASSERT(!m_loadingDocument); |
| 218 ASSERT(!m_mainScriptLoader); | 218 ASSERT(!m_mainScriptLoader); |
| 219 m_mainScriptLoader = Loader::create(); | 219 m_mainScriptLoader = Loader::create(); |
| 220 m_loadingDocument = toWebFrameImpl(frame)->frame()->document(); | 220 m_loadingDocument = toWebFrameImpl(frame)->frame()->document(); |
| 221 m_mainScriptLoader->load( | 221 m_mainScriptLoader->load( |
| 222 m_loadingDocument.get(), | 222 m_loadingDocument.get(), |
| 223 m_url, | 223 m_url, |
| 224 bind(&WebSharedWorkerImpl::didReceiveScriptLoaderResponse, this), | 224 bind(&WebSharedWorkerImpl::didReceiveScriptLoaderResponse, this), |
| 225 bind(&WebSharedWorkerImpl::onScriptLoaderFinished, this)); | 225 bind(&WebSharedWorkerImpl::onScriptLoaderFinished, this)); |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 workerThread()->runLoop().postDebuggerTask(createCallbackTask(dispatchOnInsp
ectorBackendTask, String(message))); | 432 workerThread()->runLoop().postDebuggerTask(createCallbackTask(dispatchOnInsp
ectorBackendTask, String(message))); |
| 433 WorkerDebuggerAgent::interruptAndDispatchInspectorCommands(workerThread()); | 433 WorkerDebuggerAgent::interruptAndDispatchInspectorCommands(workerThread()); |
| 434 } | 434 } |
| 435 | 435 |
| 436 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) | 436 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) |
| 437 { | 437 { |
| 438 return new WebSharedWorkerImpl(client); | 438 return new WebSharedWorkerImpl(client); |
| 439 } | 439 } |
| 440 | 440 |
| 441 } // namespace blink | 441 } // namespace blink |
| OLD | NEW |