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

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

Issue 1980273002: [Merge to M51] ServiceWorker: Remove a bad IPC message check on postMessage() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 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
« no previous file with comments | « no previous file | 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 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 #include "content/browser/service_worker/service_worker_dispatcher_host.h" 5 #include "content/browser/service_worker/service_worker_dispatcher_host.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 689
690 ServiceWorkerHandle* handle = handles_.Lookup(handle_id); 690 ServiceWorkerHandle* handle = handles_.Lookup(handle_id);
691 if (!handle) { 691 if (!handle) {
692 bad_message::ReceivedBadMessage(this, bad_message::SWDH_POST_MESSAGE); 692 bad_message::ReceivedBadMessage(this, bad_message::SWDH_POST_MESSAGE);
693 return; 693 return;
694 } 694 }
695 695
696 ServiceWorkerProviderHost* sender_provider_host = 696 ServiceWorkerProviderHost* sender_provider_host =
697 GetContext()->GetProviderHost(render_process_id_, provider_id); 697 GetContext()->GetProviderHost(render_process_id_, provider_id);
698 if (!sender_provider_host) { 698 if (!sender_provider_host) {
699 bad_message::ReceivedBadMessage(this, bad_message::SWDH_POST_MESSAGE); 699 // This may occur when destruction of the sender provider overtakes
700 // postMessage() because of thread hopping on WebServiceWorkerImpl.
700 return; 701 return;
701 } 702 }
702 703
703 DispatchExtendableMessageEvent( 704 DispatchExtendableMessageEvent(
704 make_scoped_refptr(handle->version()), message, source_origin, 705 make_scoped_refptr(handle->version()), message, source_origin,
705 sent_message_ports, sender_provider_host, 706 sent_message_ports, sender_provider_host,
706 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); 707 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback));
707 } 708 }
708 709
709 void ServiceWorkerDispatcherHost::DispatchExtendableMessageEvent( 710 void ServiceWorkerDispatcherHost::DispatchExtendableMessageEvent(
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
1426 if (!handle) { 1427 if (!handle) {
1427 bad_message::ReceivedBadMessage(this, 1428 bad_message::ReceivedBadMessage(this,
1428 bad_message::SWDH_TERMINATE_BAD_HANDLE); 1429 bad_message::SWDH_TERMINATE_BAD_HANDLE);
1429 return; 1430 return;
1430 } 1431 }
1431 handle->version()->StopWorker( 1432 handle->version()->StopWorker(
1432 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); 1433 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback));
1433 } 1434 }
1434 1435
1435 } // namespace content 1436 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698