| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "base/macros.h" | 5 #include "base/macros.h" |
| 6 #include "content/child/service_worker/service_worker_dispatcher.h" | 6 #include "content/child/service_worker/service_worker_dispatcher.h" |
| 7 #include "content/child/service_worker/service_worker_handle_reference.h" | 7 #include "content/child/service_worker/service_worker_handle_reference.h" |
| 8 #include "content/child/service_worker/service_worker_provider_context.h" | 8 #include "content/child/service_worker/service_worker_provider_context.h" |
| 9 #include "content/child/service_worker/web_service_worker_impl.h" | 9 #include "content/child/service_worker/web_service_worker_impl.h" |
| 10 #include "content/child/service_worker/web_service_worker_registration_impl.h" | 10 #include "content/child/service_worker/web_service_worker_registration_impl.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 void setController(std::unique_ptr<blink::WebServiceWorker::Handle> handle, | 128 void setController(std::unique_ptr<blink::WebServiceWorker::Handle> handle, |
| 129 bool shouldNotifyControllerChange) override { | 129 bool shouldNotifyControllerChange) override { |
| 130 // WebPassOwnPtr cannot be owned in Chromium, so drop the handle here. | 130 // WebPassOwnPtr cannot be owned in Chromium, so drop the handle here. |
| 131 // The destruction releases ServiceWorkerHandleReference. | 131 // The destruction releases ServiceWorkerHandleReference. |
| 132 is_set_controlled_called_ = true; | 132 is_set_controlled_called_ = true; |
| 133 } | 133 } |
| 134 | 134 |
| 135 void dispatchMessageEvent( | 135 void dispatchMessageEvent( |
| 136 std::unique_ptr<blink::WebServiceWorker::Handle> handle, | 136 std::unique_ptr<blink::WebServiceWorker::Handle> handle, |
| 137 const blink::WebString& message, | 137 const blink::WebString& message, |
| 138 const blink::WebMessagePortChannelArray& channels) override { | 138 blink::WebMessagePortChannelArray channels) override { |
| 139 // WebPassOwnPtr cannot be owned in Chromium, so drop the handle here. | 139 // WebPassOwnPtr cannot be owned in Chromium, so drop the handle here. |
| 140 // The destruction releases ServiceWorkerHandleReference. | 140 // The destruction releases ServiceWorkerHandleReference. |
| 141 is_dispatch_message_event_called_ = true; | 141 is_dispatch_message_event_called_ = true; |
| 142 } | 142 } |
| 143 | 143 |
| 144 bool is_set_controlled_called() const { return is_set_controlled_called_; } | 144 bool is_set_controlled_called() const { return is_set_controlled_called_; } |
| 145 | 145 |
| 146 bool is_dispatch_message_event_called() const { | 146 bool is_dispatch_message_event_called() const { |
| 147 return is_dispatch_message_event_called_; | 147 return is_dispatch_message_event_called_; |
| 148 } | 148 } |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 ipc_sink()->GetMessageAt(0)->type()); | 514 ipc_sink()->GetMessageAt(0)->type()); |
| 515 EXPECT_EQ(ServiceWorkerHostMsg_DecrementServiceWorkerRefCount::ID, | 515 EXPECT_EQ(ServiceWorkerHostMsg_DecrementServiceWorkerRefCount::ID, |
| 516 ipc_sink()->GetMessageAt(1)->type()); | 516 ipc_sink()->GetMessageAt(1)->type()); |
| 517 EXPECT_EQ(ServiceWorkerHostMsg_DecrementServiceWorkerRefCount::ID, | 517 EXPECT_EQ(ServiceWorkerHostMsg_DecrementServiceWorkerRefCount::ID, |
| 518 ipc_sink()->GetMessageAt(2)->type()); | 518 ipc_sink()->GetMessageAt(2)->type()); |
| 519 EXPECT_EQ(ServiceWorkerHostMsg_DecrementRegistrationRefCount::ID, | 519 EXPECT_EQ(ServiceWorkerHostMsg_DecrementRegistrationRefCount::ID, |
| 520 ipc_sink()->GetMessageAt(3)->type()); | 520 ipc_sink()->GetMessageAt(3)->type()); |
| 521 } | 521 } |
| 522 | 522 |
| 523 } // namespace content | 523 } // namespace content |
| OLD | NEW |