| 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 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <functional> | 10 #include <functional> |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 void DispatchMessageEvent( | 248 void DispatchMessageEvent( |
| 249 const base::string16& message, | 249 const base::string16& message, |
| 250 const std::vector<TransferredMessagePort>& sent_message_ports, | 250 const std::vector<TransferredMessagePort>& sent_message_ports, |
| 251 const StatusCallback& callback); | 251 const StatusCallback& callback); |
| 252 | 252 |
| 253 // Sends an extendable message event to the associated embedded worker. | 253 // Sends an extendable message event to the associated embedded worker. |
| 254 // TODO(nhiroki): This should be moved to ServiceWorkerDispatcherHost in favor | 254 // TODO(nhiroki): This should be moved to ServiceWorkerDispatcherHost in favor |
| 255 // of crbug.com/570820 after ExtendableMessageEvent is implemented | 255 // of crbug.com/570820 after ExtendableMessageEvent is implemented |
| 256 // (crbug.com/543198). | 256 // (crbug.com/543198). |
| 257 void DispatchExtendableMessageEvent( | 257 void DispatchExtendableMessageEvent( |
| 258 ServiceWorkerProviderHost* sender_provider_host, |
| 258 const base::string16& message, | 259 const base::string16& message, |
| 259 const std::vector<TransferredMessagePort>& sent_message_ports, | 260 const std::vector<TransferredMessagePort>& sent_message_ports, |
| 260 const StatusCallback& callback); | 261 const StatusCallback& callback); |
| 261 | 262 |
| 262 // Sends a cross origin message event to the associated embedded worker and | 263 // Sends a cross origin message event to the associated embedded worker and |
| 263 // asynchronously calls |callback| when the message was sent (or failed to | 264 // asynchronously calls |callback| when the message was sent (or failed to |
| 264 // sent). | 265 // sent). |
| 265 // It is the responsibility of the code calling this method to make sure that | 266 // It is the responsibility of the code calling this method to make sure that |
| 266 // any transferred message ports are put on hold while potentially a process | 267 // any transferred message ports are put on hold while potentially a process |
| 267 // for the service worker is spun up. | 268 // for the service worker is spun up. |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 const GURL& source_url) override; | 517 const GURL& source_url) override; |
| 517 void OnReportConsoleMessage(int source_identifier, | 518 void OnReportConsoleMessage(int source_identifier, |
| 518 int message_level, | 519 int message_level, |
| 519 const base::string16& message, | 520 const base::string16& message, |
| 520 int line_number, | 521 int line_number, |
| 521 const GURL& source_url) override; | 522 const GURL& source_url) override; |
| 522 bool OnMessageReceived(const IPC::Message& message) override; | 523 bool OnMessageReceived(const IPC::Message& message) override; |
| 523 | 524 |
| 524 void OnStartSentAndScriptEvaluated(ServiceWorkerStatusCode status); | 525 void OnStartSentAndScriptEvaluated(ServiceWorkerStatusCode status); |
| 525 | 526 |
| 527 template <typename SourceInfo> |
| 528 void DispatchExtendableMessageEventInternal( |
| 529 const base::string16& message, |
| 530 const std::vector<TransferredMessagePort>& sent_message_ports, |
| 531 const StatusCallback& callback, |
| 532 const SourceInfo& source_info); |
| 526 void DispatchExtendableMessageEventAfterStartWorker( | 533 void DispatchExtendableMessageEventAfterStartWorker( |
| 527 const base::string16& message, | 534 const base::string16& message, |
| 528 const std::vector<TransferredMessagePort>& sent_message_ports, | 535 const std::vector<TransferredMessagePort>& sent_message_ports, |
| 536 const ExtendableMessageEventSource& source, |
| 529 const StatusCallback& callback); | 537 const StatusCallback& callback); |
| 530 | 538 |
| 531 void DispatchMessageEventInternal( | 539 void DispatchMessageEventInternal( |
| 532 const base::string16& message, | 540 const base::string16& message, |
| 533 const std::vector<TransferredMessagePort>& sent_message_ports, | 541 const std::vector<TransferredMessagePort>& sent_message_ports, |
| 534 const StatusCallback& callback); | 542 const StatusCallback& callback); |
| 535 | 543 |
| 536 // Message handlers. | 544 // Message handlers. |
| 537 | 545 |
| 538 // This corresponds to the spec's get(id) steps. | 546 // This corresponds to the spec's get(id) steps. |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 | 815 |
| 808 // At this point |this| can have been deleted, so don't do anything other | 816 // At this point |this| can have been deleted, so don't do anything other |
| 809 // than returning. | 817 // than returning. |
| 810 | 818 |
| 811 return true; | 819 return true; |
| 812 } | 820 } |
| 813 | 821 |
| 814 } // namespace content | 822 } // namespace content |
| 815 | 823 |
| 816 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 824 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| OLD | NEW |