| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/service_worker/service_worker_dispatcher_host.h" | 5 #include "content/browser/service_worker/service_worker_dispatcher_host.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "content/browser/message_port_message_filter.h" | 9 #include "content/browser/message_port_message_filter.h" |
| 10 #include "content/browser/message_port_service.h" | 10 #include "content/browser/message_port_service.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 BrowserThread::IO, FROM_HERE, | 63 BrowserThread::IO, FROM_HERE, |
| 64 base::Bind(&ServiceWorkerDispatcherHost::Init, | 64 base::Bind(&ServiceWorkerDispatcherHost::Init, |
| 65 this, make_scoped_refptr(context_wrapper))); | 65 this, make_scoped_refptr(context_wrapper))); |
| 66 return; | 66 return; |
| 67 } | 67 } |
| 68 context_wrapper_ = context_wrapper; | 68 context_wrapper_ = context_wrapper; |
| 69 GetContext()->embedded_worker_registry()->AddChildProcessSender( | 69 GetContext()->embedded_worker_registry()->AddChildProcessSender( |
| 70 render_process_id_, this); | 70 render_process_id_, this); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void ServiceWorkerDispatcherHost::OnFilterAdded(IPC::Sender* sender) { | 73 void ServiceWorkerDispatcherHost::OnFilterAdded(IPC::Channel* channel) { |
| 74 BrowserMessageFilter::OnFilterAdded(sender); | 74 BrowserMessageFilter::OnFilterAdded(channel); |
| 75 channel_ready_ = true; | 75 channel_ready_ = true; |
| 76 std::vector<IPC::Message*> messages; | 76 std::vector<IPC::Message*> messages; |
| 77 pending_messages_.release(&messages); | 77 pending_messages_.release(&messages); |
| 78 for (size_t i = 0; i < messages.size(); ++i) { | 78 for (size_t i = 0; i < messages.size(); ++i) { |
| 79 BrowserMessageFilter::Send(messages[i]); | 79 BrowserMessageFilter::Send(messages[i]); |
| 80 } | 80 } |
| 81 } | 81 } |
| 82 | 82 |
| 83 void ServiceWorkerDispatcherHost::OnDestruct() const { | 83 void ServiceWorkerDispatcherHost::OnDestruct() const { |
| 84 BrowserThread::DeleteOnIOThread::Destruct(this); | 84 BrowserThread::DeleteOnIOThread::Destruct(this); |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 status, &error_type, &error_message); | 433 status, &error_type, &error_message); |
| 434 Send(new ServiceWorkerMsg_ServiceWorkerRegistrationError( | 434 Send(new ServiceWorkerMsg_ServiceWorkerRegistrationError( |
| 435 thread_id, request_id, error_type, error_message)); | 435 thread_id, request_id, error_type, error_message)); |
| 436 } | 436 } |
| 437 | 437 |
| 438 ServiceWorkerContextCore* ServiceWorkerDispatcherHost::GetContext() { | 438 ServiceWorkerContextCore* ServiceWorkerDispatcherHost::GetContext() { |
| 439 return context_wrapper_->context(); | 439 return context_wrapper_->context(); |
| 440 } | 440 } |
| 441 | 441 |
| 442 } // namespace content | 442 } // namespace content |
| OLD | NEW |