| 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 // to have same origin as the worker so the loading checks work correctly. | 314 // to have same origin as the worker so the loading checks work correctly. |
| 315 CString content(""); | 315 CString content(""); |
| 316 RefPtr<SharedBuffer> buffer( | 316 RefPtr<SharedBuffer> buffer( |
| 317 SharedBuffer::Create(content.data(), content.length())); | 317 SharedBuffer::Create(content.data(), content.length())); |
| 318 loading_shadow_page_ = true; | 318 loading_shadow_page_ = true; |
| 319 main_frame_->GetFrame()->Loader().Load( | 319 main_frame_->GetFrame()->Loader().Load( |
| 320 FrameLoadRequest(0, ResourceRequest(worker_start_data_.script_url), | 320 FrameLoadRequest(0, ResourceRequest(worker_start_data_.script_url), |
| 321 SubstituteData(buffer, "text/html", "UTF-8", KURL()))); | 321 SubstituteData(buffer, "text/html", "UTF-8", KURL()))); |
| 322 } | 322 } |
| 323 | 323 |
| 324 void WebEmbeddedWorkerImpl::FrameDetached(WebLocalFrame* frame, |
| 325 DetachType type) { |
| 326 DCHECK(type == DetachType::kRemove && frame->Parent()); |
| 327 DCHECK(frame->FrameWidget()); |
| 328 frame->Close(); |
| 329 } |
| 330 |
| 324 void WebEmbeddedWorkerImpl::DidFinishDocumentLoad() { | 331 void WebEmbeddedWorkerImpl::DidFinishDocumentLoad() { |
| 325 DCHECK(!main_script_loader_); | 332 DCHECK(!main_script_loader_); |
| 326 DCHECK(main_frame_); | 333 DCHECK(main_frame_); |
| 327 DCHECK(worker_context_client_); | 334 DCHECK(worker_context_client_); |
| 328 DCHECK(loading_shadow_page_); | 335 DCHECK(loading_shadow_page_); |
| 329 DCHECK(!asked_to_terminate_); | 336 DCHECK(!asked_to_terminate_); |
| 330 loading_shadow_page_ = false; | 337 loading_shadow_page_ = false; |
| 331 main_frame_->DataSource()->SetServiceWorkerNetworkProvider( | 338 main_frame_->DataSource()->SetServiceWorkerNetworkProvider( |
| 332 worker_context_client_->CreateServiceWorkerNetworkProvider()); | 339 worker_context_client_->CreateServiceWorkerNetworkProvider()); |
| 333 main_script_loader_ = WorkerScriptLoader::Create(); | 340 main_script_loader_ = WorkerScriptLoader::Create(); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 // populate the task runners with null document not to confuse the frame | 480 // populate the task runners with null document not to confuse the frame |
| 474 // scheduler (which will end up using the thread's default task runner). | 481 // scheduler (which will end up using the thread's default task runner). |
| 475 worker_thread_->Start(std::move(startup_data), | 482 worker_thread_->Start(std::move(startup_data), |
| 476 ParentFrameTaskRunners::Create(nullptr)); | 483 ParentFrameTaskRunners::Create(nullptr)); |
| 477 | 484 |
| 478 worker_inspector_proxy_->WorkerThreadCreated(document, worker_thread_.get(), | 485 worker_inspector_proxy_->WorkerThreadCreated(document, worker_thread_.get(), |
| 479 script_url); | 486 script_url); |
| 480 } | 487 } |
| 481 | 488 |
| 482 } // namespace blink | 489 } // namespace blink |
| OLD | NEW |