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

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

Issue 1701843002: ServiceWorker: Implement 'source' and 'origin' attributes of ExtendableMessageEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_focus_into_utils
Patch Set: clean up tests Created 4 years, 9 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 #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
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,
260 const url::Origin& source_origin,
259 const std::vector<TransferredMessagePort>& sent_message_ports, 261 const std::vector<TransferredMessagePort>& sent_message_ports,
260 const StatusCallback& callback); 262 const StatusCallback& callback);
261 263
262 // Sends a cross origin message event to the associated embedded worker and 264 // Sends a cross origin message event to the associated embedded worker and
263 // asynchronously calls |callback| when the message was sent (or failed to 265 // asynchronously calls |callback| when the message was sent (or failed to
264 // sent). 266 // sent).
265 // It is the responsibility of the code calling this method to make sure that 267 // 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 268 // any transferred message ports are put on hold while potentially a process
267 // for the service worker is spun up. 269 // for the service worker is spun up.
268 // 270 //
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 const GURL& source_url) override; 511 const GURL& source_url) override;
510 void OnReportConsoleMessage(int source_identifier, 512 void OnReportConsoleMessage(int source_identifier,
511 int message_level, 513 int message_level,
512 const base::string16& message, 514 const base::string16& message,
513 int line_number, 515 int line_number,
514 const GURL& source_url) override; 516 const GURL& source_url) override;
515 bool OnMessageReceived(const IPC::Message& message) override; 517 bool OnMessageReceived(const IPC::Message& message) override;
516 518
517 void OnStartSentAndScriptEvaluated(ServiceWorkerStatusCode status); 519 void OnStartSentAndScriptEvaluated(ServiceWorkerStatusCode status);
518 520
521 template <typename SourceInfo>
522 void DispatchExtendableMessageEventInternal(
523 const base::string16& message,
524 const url::Origin& source_origin,
525 const std::vector<TransferredMessagePort>& sent_message_ports,
526 const StatusCallback& callback,
527 const SourceInfo& source_info);
519 void DispatchExtendableMessageEventAfterStartWorker( 528 void DispatchExtendableMessageEventAfterStartWorker(
520 const base::string16& message, 529 const base::string16& message,
530 const url::Origin& source_origin,
521 const std::vector<TransferredMessagePort>& sent_message_ports, 531 const std::vector<TransferredMessagePort>& sent_message_ports,
532 const ExtendableMessageEventSource& source,
522 const StatusCallback& callback); 533 const StatusCallback& callback);
523 534
524 void DispatchMessageEventInternal( 535 void DispatchMessageEventInternal(
525 const base::string16& message, 536 const base::string16& message,
526 const std::vector<TransferredMessagePort>& sent_message_ports, 537 const std::vector<TransferredMessagePort>& sent_message_ports,
527 const StatusCallback& callback); 538 const StatusCallback& callback);
528 539
529 // Message handlers. 540 // Message handlers.
530 541
531 // This corresponds to the spec's get(id) steps. 542 // This corresponds to the spec's get(id) steps.
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 792
782 // At this point |this| can have been deleted, so don't do anything other 793 // At this point |this| can have been deleted, so don't do anything other
783 // than returning. 794 // than returning.
784 795
785 return true; 796 return true;
786 } 797 }
787 798
788 } // namespace content 799 } // namespace content
789 800
790 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_ 801 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_VERSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698