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

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

Issue 246023007: Chromium-side plumbing for ServiceWorker -> Document postMessage (2/3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: message port threading fix Created 6 years, 7 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 | Annotate | Revision Log
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_PROVIDER_HOST_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_
7 7
8 #include <set> 8 #include <set>
9 #include <vector>
9 10
10 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
11 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
12 #include "content/common/content_export.h" 13 #include "content/common/content_export.h"
13 #include "webkit/common/resource_type.h" 14 #include "webkit/common/resource_type.h"
14 15
15 namespace IPC { 16 namespace IPC {
16 class Sender; 17 class Sender;
17 } 18 }
18 19
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 77
77 // Returns false if the version is not in the expected STARTING in our 78 // Returns false if the version is not in the expected STARTING in our
78 // our process state. That would be indicative of a bad IPC message. 79 // our process state. That would be indicative of a bad IPC message.
79 bool SetHostedVersionId(int64 versions_id); 80 bool SetHostedVersionId(int64 versions_id);
80 81
81 // Returns a handler for a request, the handler may return NULL if 82 // Returns a handler for a request, the handler may return NULL if
82 // the request doesn't require special handling. 83 // the request doesn't require special handling.
83 scoped_ptr<ServiceWorkerRequestHandler> CreateRequestHandler( 84 scoped_ptr<ServiceWorkerRequestHandler> CreateRequestHandler(
84 ResourceType::Type resource_type); 85 ResourceType::Type resource_type);
85 86
87 // Dispatches message event to the document.
88 void PostMessage(const base::string16& message,
89 const std::vector<int>& sent_message_port_ids);
90
86 private: 91 private:
87 const int process_id_; 92 const int process_id_;
88 const int provider_id_; 93 const int provider_id_;
89 GURL document_url_; 94 GURL document_url_;
90 scoped_refptr<ServiceWorkerVersion> active_version_; 95 scoped_refptr<ServiceWorkerVersion> active_version_;
91 scoped_refptr<ServiceWorkerVersion> pending_version_; 96 scoped_refptr<ServiceWorkerVersion> pending_version_;
92 scoped_refptr<ServiceWorkerVersion> running_hosted_version_; 97 scoped_refptr<ServiceWorkerVersion> running_hosted_version_;
93 base::WeakPtr<ServiceWorkerContextCore> context_; 98 base::WeakPtr<ServiceWorkerContextCore> context_;
94 ServiceWorkerDispatcherHost* dispatcher_host_; 99 ServiceWorkerDispatcherHost* dispatcher_host_;
95 100
96 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost); 101 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerProviderHost);
97 }; 102 };
98 103
99 } // namespace content 104 } // namespace content
100 105
101 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_ 106 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698