| 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 "content/renderer/service_worker/service_worker_context_client.h" | 5 #include "content/renderer/service_worker/service_worker_context_client.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 // to overtake those messages. | 606 // to overtake those messages. |
| 607 scoped_ptr<blink::WebMessagePortChannelArray> channel_array(channels); | 607 scoped_ptr<blink::WebMessagePortChannelArray> channel_array(channels); |
| 608 main_thread_task_runner_->PostTask( | 608 main_thread_task_runner_->PostTask( |
| 609 FROM_HERE, base::Bind(&SendPostMessageToClientOnMainThread, | 609 FROM_HERE, base::Bind(&SendPostMessageToClientOnMainThread, |
| 610 base::RetainedRef(sender_), GetRoutingID(), | 610 base::RetainedRef(sender_), GetRoutingID(), |
| 611 base::UTF16ToUTF8(base::StringPiece16(uuid)), | 611 base::UTF16ToUTF8(base::StringPiece16(uuid)), |
| 612 static_cast<base::string16>(message), | 612 static_cast<base::string16>(message), |
| 613 base::Passed(&channel_array))); | 613 base::Passed(&channel_array))); |
| 614 } | 614 } |
| 615 | 615 |
| 616 void ServiceWorkerContextClient::postMessageToCrossOriginClient( |
| 617 const blink::WebCrossOriginServiceWorkerClient&, |
| 618 const blink::WebString&, |
| 619 blink::WebMessagePortChannelArray*) { |
| 620 NOTREACHED(); |
| 621 } |
| 622 |
| 616 void ServiceWorkerContextClient::focus( | 623 void ServiceWorkerContextClient::focus( |
| 617 const blink::WebString& uuid, | 624 const blink::WebString& uuid, |
| 618 blink::WebServiceWorkerClientCallbacks* callback) { | 625 blink::WebServiceWorkerClientCallbacks* callback) { |
| 619 DCHECK(callback); | 626 DCHECK(callback); |
| 620 int request_id = context_->client_callbacks.Add(callback); | 627 int request_id = context_->client_callbacks.Add(callback); |
| 621 Send(new ServiceWorkerHostMsg_FocusClient( | 628 Send(new ServiceWorkerHostMsg_FocusClient( |
| 622 GetRoutingID(), request_id, | 629 GetRoutingID(), request_id, |
| 623 base::UTF16ToUTF8(base::StringPiece16(uuid)))); | 630 base::UTF16ToUTF8(base::StringPiece16(uuid)))); |
| 624 } | 631 } |
| 625 | 632 |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 } | 1045 } |
| 1039 | 1046 |
| 1040 base::WeakPtr<ServiceWorkerContextClient> | 1047 base::WeakPtr<ServiceWorkerContextClient> |
| 1041 ServiceWorkerContextClient::GetWeakPtr() { | 1048 ServiceWorkerContextClient::GetWeakPtr() { |
| 1042 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 1049 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
| 1043 DCHECK(context_); | 1050 DCHECK(context_); |
| 1044 return context_->weak_factory.GetWeakPtr(); | 1051 return context_->weak_factory.GetWeakPtr(); |
| 1045 } | 1052 } |
| 1046 | 1053 |
| 1047 } // namespace content | 1054 } // namespace content |
| OLD | NEW |