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::Channel* channel) { | 73 void ServiceWorkerDispatcherHost::OnFilterAdded(IPC::Sender* sender) { |
74 BrowserMessageFilter::OnFilterAdded(channel); | 74 BrowserMessageFilter::OnFilterAdded(sender); |
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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 status, &error_type, &error_message); | 410 status, &error_type, &error_message); |
411 Send(new ServiceWorkerMsg_ServiceWorkerRegistrationError( | 411 Send(new ServiceWorkerMsg_ServiceWorkerRegistrationError( |
412 thread_id, request_id, error_type, error_message)); | 412 thread_id, request_id, error_type, error_message)); |
413 } | 413 } |
414 | 414 |
415 ServiceWorkerContextCore* ServiceWorkerDispatcherHost::GetContext() { | 415 ServiceWorkerContextCore* ServiceWorkerDispatcherHost::GetContext() { |
416 return context_wrapper_->context(); | 416 return context_wrapper_->context(); |
417 } | 417 } |
418 | 418 |
419 } // namespace content | 419 } // namespace content |
OLD | NEW |