| 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" |
| 11 #include "content/browser/background_sync/background_sync_context.h" | 11 #include "content/browser/background_sync/background_sync_context.h" |
| 12 #include "content/browser/background_sync/background_sync_manager.h" | 12 #include "content/browser/background_sync/background_sync_manager.h" |
| 13 #include "content/browser/devtools/service_worker_devtools_agent_host.h" | 13 #include "content/browser/devtools/service_worker_devtools_agent_host.h" |
| 14 #include "content/browser/devtools/service_worker_devtools_manager.h" | 14 #include "content/browser/devtools/service_worker_devtools_manager.h" |
| 15 #include "content/browser/frame_host/frame_tree.h" | 15 #include "content/browser/frame_host/frame_tree.h" |
| 16 #include "content/browser/frame_host/frame_tree_node.h" | 16 #include "content/browser/frame_host/frame_tree_node.h" |
| 17 #include "content/browser/frame_host/render_frame_host_impl.h" | 17 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 18 #include "content/browser/service_worker/embedded_worker_status.h" |
| 18 #include "content/browser/service_worker/service_worker_context_watcher.h" | 19 #include "content/browser/service_worker/service_worker_context_watcher.h" |
| 19 #include "content/browser/service_worker/service_worker_context_wrapper.h" | 20 #include "content/browser/service_worker/service_worker_context_wrapper.h" |
| 20 #include "content/browser/service_worker/service_worker_version.h" | 21 #include "content/browser/service_worker/service_worker_version.h" |
| 21 #include "content/browser/storage_partition_impl_map.h" | 22 #include "content/browser/storage_partition_impl_map.h" |
| 22 #include "content/common/service_worker/service_worker_utils.h" | 23 #include "content/common/service_worker/service_worker_utils.h" |
| 23 #include "content/public/browser/browser_context.h" | 24 #include "content/public/browser/browser_context.h" |
| 24 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
| 25 #include "content/public/browser/devtools_agent_host.h" | 26 #include "content/public/browser/devtools_agent_host.h" |
| 26 #include "content/public/browser/render_frame_host.h" | 27 #include "content/public/browser/render_frame_host.h" |
| 27 #include "content/public/browser/render_process_host.h" | 28 #include "content/public/browser/render_process_host.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 55 | 56 |
| 56 void StatusNoOpKeepingRegistration( | 57 void StatusNoOpKeepingRegistration( |
| 57 scoped_refptr<content::ServiceWorkerRegistration> protect, | 58 scoped_refptr<content::ServiceWorkerRegistration> protect, |
| 58 ServiceWorkerStatusCode status) { | 59 ServiceWorkerStatusCode status) { |
| 59 } | 60 } |
| 60 | 61 |
| 61 void PushDeliveryNoOp(PushDeliveryStatus status) { | 62 void PushDeliveryNoOp(PushDeliveryStatus status) { |
| 62 } | 63 } |
| 63 | 64 |
| 64 const std::string GetVersionRunningStatusString( | 65 const std::string GetVersionRunningStatusString( |
| 65 content::ServiceWorkerVersion::RunningStatus running_status) { | 66 EmbeddedWorkerStatus running_status) { |
| 66 switch (running_status) { | 67 switch (running_status) { |
| 67 case content::ServiceWorkerVersion::STOPPED: | 68 case EmbeddedWorkerStatus::STOPPED: |
| 68 return kServiceWorkerVersionRunningStatusStopped; | 69 return kServiceWorkerVersionRunningStatusStopped; |
| 69 case content::ServiceWorkerVersion::STARTING: | 70 case EmbeddedWorkerStatus::STARTING: |
| 70 return kServiceWorkerVersionRunningStatusStarting; | 71 return kServiceWorkerVersionRunningStatusStarting; |
| 71 case content::ServiceWorkerVersion::RUNNING: | 72 case EmbeddedWorkerStatus::RUNNING: |
| 72 return kServiceWorkerVersionRunningStatusRunning; | 73 return kServiceWorkerVersionRunningStatusRunning; |
| 73 case content::ServiceWorkerVersion::STOPPING: | 74 case EmbeddedWorkerStatus::STOPPING: |
| 74 return kServiceWorkerVersionRunningStatusStopping; | 75 return kServiceWorkerVersionRunningStatusStopping; |
| 75 } | 76 } |
| 76 return std::string(); | 77 return std::string(); |
| 77 } | 78 } |
| 78 | 79 |
| 79 const std::string GetVersionStatusString( | 80 const std::string GetVersionStatusString( |
| 80 content::ServiceWorkerVersion::Status status) { | 81 content::ServiceWorkerVersion::Status status) { |
| 81 switch (status) { | 82 switch (status) { |
| 82 case content::ServiceWorkerVersion::NEW: | 83 case content::ServiceWorkerVersion::NEW: |
| 83 return kServiceWorkerVersionStatusNew; | 84 return kServiceWorkerVersionStatusNew; |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 } | 692 } |
| 692 | 693 |
| 693 void ServiceWorkerHandler::ClearForceUpdate() { | 694 void ServiceWorkerHandler::ClearForceUpdate() { |
| 694 if (context_) | 695 if (context_) |
| 695 context_->SetForceUpdateOnPageLoad(false); | 696 context_->SetForceUpdateOnPageLoad(false); |
| 696 } | 697 } |
| 697 | 698 |
| 698 } // namespace service_worker | 699 } // namespace service_worker |
| 699 } // namespace devtools | 700 } // namespace devtools |
| 700 } // namespace content | 701 } // namespace content |
| OLD | NEW |