OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_REQUEST_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "base/supports_user_data.h" | 10 #include "base/supports_user_data.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 virtual void GetExtraResponseInfo( | 102 virtual void GetExtraResponseInfo( |
103 ResourceResponseInfo* response_info) const = 0; | 103 ResourceResponseInfo* response_info) const = 0; |
104 | 104 |
105 // Methods to support cross site navigations. | 105 // Methods to support cross site navigations. |
106 void PrepareForCrossSiteTransfer(int old_process_id); | 106 void PrepareForCrossSiteTransfer(int old_process_id); |
107 void CompleteCrossSiteTransfer(int new_process_id, | 107 void CompleteCrossSiteTransfer(int new_process_id, |
108 int new_provider_id); | 108 int new_provider_id); |
109 void MaybeCompleteCrossSiteTransferInOldProcess( | 109 void MaybeCompleteCrossSiteTransferInOldProcess( |
110 int old_process_id); | 110 int old_process_id); |
111 | 111 |
112 ServiceWorkerContextCore* context() const { return context_.get(); } | |
113 | |
114 protected: | 112 protected: |
115 ServiceWorkerRequestHandler( | 113 ServiceWorkerRequestHandler( |
116 base::WeakPtr<ServiceWorkerContextCore> context, | 114 base::WeakPtr<ServiceWorkerContextCore> context, |
117 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 115 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
118 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, | 116 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
119 ResourceType resource_type); | 117 ResourceType resource_type); |
120 | 118 |
121 base::WeakPtr<ServiceWorkerContextCore> context_; | 119 base::WeakPtr<ServiceWorkerContextCore> context_; |
122 base::WeakPtr<ServiceWorkerProviderHost> provider_host_; | 120 base::WeakPtr<ServiceWorkerProviderHost> provider_host_; |
123 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; | 121 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; |
124 ResourceType resource_type_; | 122 ResourceType resource_type_; |
125 | 123 |
126 private: | 124 private: |
127 scoped_ptr<ServiceWorkerProviderHost> host_for_cross_site_transfer_; | 125 scoped_ptr<ServiceWorkerProviderHost> host_for_cross_site_transfer_; |
128 int old_process_id_; | 126 int old_process_id_; |
129 int old_provider_id_; | 127 int old_provider_id_; |
130 | 128 |
131 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); | 129 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); |
132 }; | 130 }; |
133 | 131 |
134 } // namespace content | 132 } // namespace content |
135 | 133 |
136 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ | 134 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ |
OLD | NEW |