OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/service_worker/service_worker_version.h" | 5 #include "content/browser/service_worker/service_worker_version.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1424 context_->GetProviderHostByClientID(client_uuid); | 1424 context_->GetProviderHostByClientID(client_uuid); |
1425 if (!provider_host) { | 1425 if (!provider_host) { |
1426 // The client may already have been closed, just ignore. | 1426 // The client may already have been closed, just ignore. |
1427 return; | 1427 return; |
1428 } | 1428 } |
1429 if (provider_host->document_url().GetOrigin() != script_url_.GetOrigin()) { | 1429 if (provider_host->document_url().GetOrigin() != script_url_.GetOrigin()) { |
1430 // The client does not belong to the same origin as this ServiceWorker, | 1430 // The client does not belong to the same origin as this ServiceWorker, |
1431 // possibly due to timing issue or bad message. | 1431 // possibly due to timing issue or bad message. |
1432 return; | 1432 return; |
1433 } | 1433 } |
1434 provider_host->PostMessage(message, sent_message_ports); | 1434 provider_host->PostMessage(this, message, sent_message_ports); |
1435 } | 1435 } |
1436 | 1436 |
1437 void ServiceWorkerVersion::OnFocusClient(int request_id, | 1437 void ServiceWorkerVersion::OnFocusClient(int request_id, |
1438 const std::string& client_uuid) { | 1438 const std::string& client_uuid) { |
1439 if (!context_) | 1439 if (!context_) |
1440 return; | 1440 return; |
1441 TRACE_EVENT2("ServiceWorker", | 1441 TRACE_EVENT2("ServiceWorker", |
1442 "ServiceWorkerVersion::OnFocusClient", | 1442 "ServiceWorkerVersion::OnFocusClient", |
1443 "Request id", request_id, | 1443 "Request id", request_id, |
1444 "Client id", client_uuid); | 1444 "Client id", client_uuid); |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1878 return SERVICE_WORKER_ERROR_ABORT; | 1878 return SERVICE_WORKER_ERROR_ABORT; |
1879 default: | 1879 default: |
1880 return SERVICE_WORKER_ERROR_NETWORK; | 1880 return SERVICE_WORKER_ERROR_NETWORK; |
1881 } | 1881 } |
1882 } | 1882 } |
1883 | 1883 |
1884 return default_code; | 1884 return default_code; |
1885 } | 1885 } |
1886 | 1886 |
1887 } // namespace content | 1887 } // namespace content |
OLD | NEW |