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

Side by Side Diff: content/browser/service_worker/service_worker_request_handler.cc

Issue 325173002: ServiceWorker: Confirm the liveness of the associated context before handling message (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix more Created 6 years, 6 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
« no previous file with comments | « content/browser/service_worker/service_worker_register_job.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "content/browser/service_worker/service_worker_request_handler.h" 5 #include "content/browser/service_worker/service_worker_request_handler.h"
6 6
7 #include "content/browser/service_worker/service_worker_context_core.h" 7 #include "content/browser/service_worker/service_worker_context_core.h"
8 #include "content/browser/service_worker/service_worker_context_wrapper.h" 8 #include "content/browser/service_worker/service_worker_context_wrapper.h"
9 #include "content/browser/service_worker/service_worker_provider_host.h" 9 #include "content/browser/service_worker/service_worker_provider_host.h"
10 #include "content/browser/service_worker/service_worker_registration.h" 10 #include "content/browser/service_worker/service_worker_registration.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 return; 63 return;
64 } 64 }
65 65
66 if (!context_wrapper || !context_wrapper->context() || 66 if (!context_wrapper || !context_wrapper->context() ||
67 provider_id == kInvalidServiceWorkerProviderId) { 67 provider_id == kInvalidServiceWorkerProviderId) {
68 return; 68 return;
69 } 69 }
70 70
71 ServiceWorkerProviderHost* provider_host = 71 ServiceWorkerProviderHost* provider_host =
72 context_wrapper->context()->GetProviderHost(process_id, provider_id); 72 context_wrapper->context()->GetProviderHost(process_id, provider_id);
73 if (!provider_host) 73 if (!provider_host || !provider_host->IsContextAlive())
74 return; 74 return;
75 75
76 scoped_ptr<ServiceWorkerRequestHandler> handler( 76 scoped_ptr<ServiceWorkerRequestHandler> handler(
77 provider_host->CreateRequestHandler(resource_type, 77 provider_host->CreateRequestHandler(resource_type,
78 blob_storage_context->AsWeakPtr())); 78 blob_storage_context->AsWeakPtr()));
79 if (!handler) 79 if (!handler)
80 return; 80 return;
81 81
82 request->SetUserData(&kUserDataKey, handler.release()); 82 request->SetUserData(&kUserDataKey, handler.release());
83 } 83 }
(...skipping 18 matching lines...) Expand all
102 base::WeakPtr<ServiceWorkerProviderHost> provider_host, 102 base::WeakPtr<ServiceWorkerProviderHost> provider_host,
103 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context, 103 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context,
104 ResourceType::Type resource_type) 104 ResourceType::Type resource_type)
105 : context_(context), 105 : context_(context),
106 provider_host_(provider_host), 106 provider_host_(provider_host),
107 blob_storage_context_(blob_storage_context), 107 blob_storage_context_(blob_storage_context),
108 resource_type_(resource_type) { 108 resource_type_(resource_type) {
109 } 109 }
110 110
111 } // namespace content 111 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/service_worker/service_worker_register_job.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698