| 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 "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "content/child/service_worker/service_worker_dispatcher.h" | 7 #include "content/child/service_worker/service_worker_dispatcher.h" |
| 8 #include "content/child/service_worker/service_worker_handle_reference.h" | 8 #include "content/child/service_worker/service_worker_handle_reference.h" |
| 9 #include "content/child/service_worker/service_worker_provider_context.h" | 9 #include "content/child/service_worker/service_worker_provider_context.h" |
| 10 #include "content/child/service_worker/web_service_worker_impl.h" | 10 #include "content/child/service_worker/web_service_worker_impl.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 void setController(std::unique_ptr<blink::WebServiceWorker::Handle> handle, | 131 void setController(std::unique_ptr<blink::WebServiceWorker::Handle> handle, |
| 132 bool shouldNotifyControllerChange) override { | 132 bool shouldNotifyControllerChange) override { |
| 133 // WebPassOwnPtr cannot be owned in Chromium, so drop the handle here. | 133 // WebPassOwnPtr cannot be owned in Chromium, so drop the handle here. |
| 134 // The destruction releases ServiceWorkerHandleReference. | 134 // The destruction releases ServiceWorkerHandleReference. |
| 135 is_set_controlled_called_ = true; | 135 is_set_controlled_called_ = true; |
| 136 } | 136 } |
| 137 | 137 |
| 138 void dispatchMessageEvent( | 138 void dispatchMessageEvent( |
| 139 std::unique_ptr<blink::WebServiceWorker::Handle> handle, | 139 std::unique_ptr<blink::WebServiceWorker::Handle> handle, |
| 140 const blink::WebString& message, | 140 const blink::WebString& message, |
| 141 const blink::WebMessagePortChannelArray& channels) override { | 141 blink::WebMessagePortChannelArray channels) override { |
| 142 // WebPassOwnPtr cannot be owned in Chromium, so drop the handle here. | 142 // WebPassOwnPtr cannot be owned in Chromium, so drop the handle here. |
| 143 // The destruction releases ServiceWorkerHandleReference. | 143 // The destruction releases ServiceWorkerHandleReference. |
| 144 is_dispatch_message_event_called_ = true; | 144 is_dispatch_message_event_called_ = true; |
| 145 } | 145 } |
| 146 | 146 |
| 147 void countFeature(uint32_t feature) override { | 147 void countFeature(uint32_t feature) override { |
| 148 used_features_.insert(feature); | 148 used_features_.insert(feature); |
| 149 } | 149 } |
| 150 | 150 |
| 151 bool is_set_controlled_called() const { return is_set_controlled_called_; } | 151 bool is_set_controlled_called() const { return is_set_controlled_called_; } |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 ipc_sink()->GetMessageAt(0)->type()); | 526 ipc_sink()->GetMessageAt(0)->type()); |
| 527 EXPECT_EQ(ServiceWorkerHostMsg_DecrementServiceWorkerRefCount::ID, | 527 EXPECT_EQ(ServiceWorkerHostMsg_DecrementServiceWorkerRefCount::ID, |
| 528 ipc_sink()->GetMessageAt(1)->type()); | 528 ipc_sink()->GetMessageAt(1)->type()); |
| 529 EXPECT_EQ(ServiceWorkerHostMsg_DecrementServiceWorkerRefCount::ID, | 529 EXPECT_EQ(ServiceWorkerHostMsg_DecrementServiceWorkerRefCount::ID, |
| 530 ipc_sink()->GetMessageAt(2)->type()); | 530 ipc_sink()->GetMessageAt(2)->type()); |
| 531 EXPECT_EQ(ServiceWorkerHostMsg_DecrementRegistrationRefCount::ID, | 531 EXPECT_EQ(ServiceWorkerHostMsg_DecrementRegistrationRefCount::ID, |
| 532 ipc_sink()->GetMessageAt(3)->type()); | 532 ipc_sink()->GetMessageAt(3)->type()); |
| 533 } | 533 } |
| 534 | 534 |
| 535 } // namespace content | 535 } // namespace content |
| OLD | NEW |