Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(274)

Side by Side Diff: content/browser/service_worker/service_worker_version.cc

Issue 1141813002: ServiceWorker: Introduce ServiceWorkerMessageEvent to replace MessageEvent (2/3). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/location.h" 8 #include "base/location.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 1581 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 context_->GetProviderHostByClientID(client_uuid); 1592 context_->GetProviderHostByClientID(client_uuid);
1593 if (!provider_host) { 1593 if (!provider_host) {
1594 // The client may already have been closed, just ignore. 1594 // The client may already have been closed, just ignore.
1595 return; 1595 return;
1596 } 1596 }
1597 if (provider_host->document_url().GetOrigin() != script_url_.GetOrigin()) { 1597 if (provider_host->document_url().GetOrigin() != script_url_.GetOrigin()) {
1598 // The client does not belong to the same origin as this ServiceWorker, 1598 // The client does not belong to the same origin as this ServiceWorker,
1599 // possibly due to timing issue or bad message. 1599 // possibly due to timing issue or bad message.
1600 return; 1600 return;
1601 } 1601 }
1602 provider_host->PostMessage(message, sent_message_ports); 1602 provider_host->PostMessage(this, message, sent_message_ports);
1603 } 1603 }
1604 1604
1605 void ServiceWorkerVersion::OnFocusClient(int request_id, 1605 void ServiceWorkerVersion::OnFocusClient(int request_id,
1606 const std::string& client_uuid) { 1606 const std::string& client_uuid) {
1607 if (!context_) 1607 if (!context_)
1608 return; 1608 return;
1609 TRACE_EVENT2("ServiceWorker", 1609 TRACE_EVENT2("ServiceWorker",
1610 "ServiceWorkerVersion::OnFocusClient", 1610 "ServiceWorkerVersion::OnFocusClient",
1611 "Request id", request_id, 1611 "Request id", request_id,
1612 "Client id", client_uuid); 1612 "Client id", client_uuid);
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after
2050 return SERVICE_WORKER_ERROR_ABORT; 2050 return SERVICE_WORKER_ERROR_ABORT;
2051 default: 2051 default:
2052 return SERVICE_WORKER_ERROR_NETWORK; 2052 return SERVICE_WORKER_ERROR_NETWORK;
2053 } 2053 }
2054 } 2054 }
2055 2055
2056 return default_code; 2056 return default_code;
2057 } 2057 }
2058 2058
2059 } // namespace content 2059 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698