| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 const GURL& source_url) override; | 510 const GURL& source_url) override; |
| 510 void OnReportConsoleMessage(int source_identifier, | 511 void OnReportConsoleMessage(int source_identifier, |
| 511 int message_level, | 512 int message_level, |
| 512 const base::string16& message, | 513 const base::string16& message, |
| 513 int line_number, | 514 int line_number, |
| 514 const GURL& source_url) override; | 515 const GURL& source_url) override; |
| 515 bool OnMessageReceived(const IPC::Message& message) override; | 516 bool OnMessageReceived(const IPC::Message& message) override; |
| 516 | 517 |
| 517 void OnStartSentAndScriptEvaluated(ServiceWorkerStatusCode status); | 518 void OnStartSentAndScriptEvaluated(ServiceWorkerStatusCode status); |
| 518 | 519 |
| 520 template <typename SourceInfo> |
| 521 void DispatchExtendableMessageEventInternal( |
| 522 const base::string16& message, |
| 523 const std::vector<TransferredMessagePort>& sent_message_ports, |
| 524 const StatusCallback& callback, |
| 525 const SourceInfo& source_info); |
| 519 void DispatchExtendableMessageEventAfterStartWorker( | 526 void DispatchExtendableMessageEventAfterStartWorker( |
| 520 const base::string16& message, | 527 const base::string16& message, |
| 521 const std::vector<TransferredMessagePort>& sent_message_ports, | 528 const std::vector<TransferredMessagePort>& sent_message_ports, |
| 529 const ExtendableMessageEventSource& source, |
| 522 const StatusCallback& callback); | 530 const StatusCallback& callback); |
| 523 | 531 |
| 524 void DispatchMessageEventInternal( | 532 void DispatchMessageEventInternal( |
| 525 const base::string16& message, | 533 const base::string16& message, |
| 526 const std::vector<TransferredMessagePort>& sent_message_ports, | 534 const std::vector<TransferredMessagePort>& sent_message_ports, |
| 527 const StatusCallback& callback); | 535 const StatusCallback& callback); |
| 528 | 536 |
| 529 // Message handlers. | 537 // Message handlers. |
| 530 | 538 |
| 531 // This corresponds to the spec's get(id) steps. | 539 // This corresponds to the spec's get(id) steps. |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 | 789 |
| 782 // At this point |this| can have been deleted, so don't do anything other | 790 // At this point |this| can have been deleted, so don't do anything other |
| 783 // than returning. | 791 // than returning. |
| 784 | 792 |
| 785 return true; | 793 return true; |
| 786 } | 794 } |
| 787 | 795 |
| 788 } // namespace content | 796 } // namespace content |
| 789 | 797 |
| 790 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ | 798 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ |
| OLD | NEW |