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/browser/devtools/protocol/service_worker_handler.h" | 5 #include "content/browser/devtools/protocol/service_worker_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/containers/scoped_ptr_hash_map.h" | 8 #include "base/containers/scoped_ptr_hash_map.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 return CreateContextErrorResponse(); | 432 return CreateContextErrorResponse(); |
433 int64 id = 0; | 433 int64 id = 0; |
434 if (!base::StringToInt64(registration_id, &id)) | 434 if (!base::StringToInt64(registration_id, &id)) |
435 return CreateInvalidVersionIdErrorResponse(); | 435 return CreateInvalidVersionIdErrorResponse(); |
436 BrowserContext::DeliverPushMessage( | 436 BrowserContext::DeliverPushMessage( |
437 render_frame_host_->GetProcess()->GetBrowserContext(), GURL(origin), id, | 437 render_frame_host_->GetProcess()->GetBrowserContext(), GURL(origin), id, |
438 data, base::Bind(&PushDeliveryNoOp)); | 438 data, base::Bind(&PushDeliveryNoOp)); |
439 return Response::OK(); | 439 return Response::OK(); |
440 } | 440 } |
441 | 441 |
442 // TODO(horo): I will remove it in crrev.com/1143363009. | |
443 Response ServiceWorkerHandler::GetTargetInfo(DevToolsCommandId command_id, | |
444 const std::string& target_id) { | |
445 return Response::InternalError("Not implemented yet"); | |
446 } | |
447 | |
448 Response ServiceWorkerHandler::GetTargetInfo( | 442 Response ServiceWorkerHandler::GetTargetInfo( |
449 const std::string& target_id, | 443 const std::string& target_id, |
450 scoped_refptr<TargetInfo>* target_info) { | 444 scoped_refptr<TargetInfo>* target_info) { |
451 scoped_refptr<DevToolsAgentHost> agent_host( | 445 scoped_refptr<DevToolsAgentHost> agent_host( |
452 DevToolsAgentHost::GetForId(target_id)); | 446 DevToolsAgentHost::GetForId(target_id)); |
453 if (!agent_host) | 447 if (!agent_host) |
454 return Response::InvalidParams("targetId"); | 448 return Response::InvalidParams("targetId"); |
455 *target_info = | 449 *target_info = |
456 TargetInfo::Create() | 450 TargetInfo::Create() |
457 ->set_id(agent_host->GetId()) | 451 ->set_id(agent_host->GetId()) |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 return; | 584 return; |
591 host->DetachClient(); | 585 host->DetachClient(); |
592 client_->WorkerTerminated(WorkerTerminatedParams::Create()-> | 586 client_->WorkerTerminated(WorkerTerminatedParams::Create()-> |
593 set_worker_id(host->GetId())); | 587 set_worker_id(host->GetId())); |
594 attached_hosts_.erase(it); | 588 attached_hosts_.erase(it); |
595 } | 589 } |
596 | 590 |
597 } // namespace service_worker | 591 } // namespace service_worker |
598 } // namespace devtools | 592 } // namespace devtools |
599 } // namespace content | 593 } // namespace content |
OLD | NEW |