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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 m_mainFrame = WebFrame::create(this); | 131 m_mainFrame = WebFrame::create(this); |
132 m_webView->setMainFrame(m_mainFrame); | 132 m_webView->setMainFrame(m_mainFrame); |
133 | 133 |
134 WebFrameImpl* webFrame = toWebFrameImpl(m_webView->mainFrame()); | 134 WebFrameImpl* webFrame = toWebFrameImpl(m_webView->mainFrame()); |
135 | 135 |
136 // Construct substitute data source for the 'shadow page'. We only need it | 136 // Construct substitute data source for the 'shadow page'. We only need it |
137 // to have same origin as the worker so the loading checks work correctly. | 137 // to have same origin as the worker so the loading checks work correctly. |
138 CString content(""); | 138 CString content(""); |
139 int length = static_cast<int>(content.length()); | 139 int length = static_cast<int>(content.length()); |
140 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), length)); | 140 RefPtr<SharedBuffer> buffer(SharedBuffer::create(content.data(), length)); |
141 webFrame->frame()->loader()->load(FrameLoadRequest(0, ResourceRequest(url),
SubstituteData(buffer, "text/html", "UTF-8", KURL()))); | 141 webFrame->frame()->loader().load(FrameLoadRequest(0, ResourceRequest(url), S
ubstituteData(buffer, "text/html", "UTF-8", KURL()))); |
142 | 142 |
143 // This document will be used as 'loading context' for the worker. | 143 // This document will be used as 'loading context' for the worker. |
144 m_loadingDocument = webFrame->frame()->document(); | 144 m_loadingDocument = webFrame->frame()->document(); |
145 } | 145 } |
146 | 146 |
147 void WebSharedWorkerImpl::didCreateDataSource(WebFrame*, WebDataSource* ds) | 147 void WebSharedWorkerImpl::didCreateDataSource(WebFrame*, WebDataSource* ds) |
148 { | 148 { |
149 // Tell the loader to load the data into the 'shadow page' synchronously, | 149 // Tell the loader to load the data into the 'shadow page' synchronously, |
150 // so we can grab the resulting Document right after load. | 150 // so we can grab the resulting Document right after load. |
151 static_cast<WebDataSourceImpl*>(ds)->setDeferMainResourceDataLoad(false); | 151 static_cast<WebDataSourceImpl*>(ds)->setDeferMainResourceDataLoad(false); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 workerThread()->runLoop().postTaskForMode(createCallbackTask(dispatchOnInspe
ctorBackendTask, String(message)), WorkerDebuggerAgent::debuggerTaskMode); | 360 workerThread()->runLoop().postTaskForMode(createCallbackTask(dispatchOnInspe
ctorBackendTask, String(message)), WorkerDebuggerAgent::debuggerTaskMode); |
361 WorkerDebuggerAgent::interruptAndDispatchInspectorCommands(workerThread()); | 361 WorkerDebuggerAgent::interruptAndDispatchInspectorCommands(workerThread()); |
362 } | 362 } |
363 | 363 |
364 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) | 364 WebSharedWorker* WebSharedWorker::create(WebSharedWorkerClient* client) |
365 { | 365 { |
366 return new WebSharedWorkerImpl(client); | 366 return new WebSharedWorkerImpl(client); |
367 } | 367 } |
368 | 368 |
369 } // namespace WebKit | 369 } // namespace WebKit |
OLD | NEW |