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

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

Issue 1977473003: ServiceWorker: Remove a bad IPC message check on postMessage() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 688
689 ServiceWorkerHandle* handle = handles_.Lookup(handle_id); 689 ServiceWorkerHandle* handle = handles_.Lookup(handle_id);
690 if (!handle) { 690 if (!handle) {
691 bad_message::ReceivedBadMessage(this, bad_message::SWDH_POST_MESSAGE); 691 bad_message::ReceivedBadMessage(this, bad_message::SWDH_POST_MESSAGE);
692 return; 692 return;
693 } 693 }
694 694
695 ServiceWorkerProviderHost* sender_provider_host = 695 ServiceWorkerProviderHost* sender_provider_host =
696 GetContext()->GetProviderHost(render_process_id_, provider_id); 696 GetContext()->GetProviderHost(render_process_id_, provider_id);
697 if (!sender_provider_host) { 697 if (!sender_provider_host) {
698 bad_message::ReceivedBadMessage(this, bad_message::SWDH_POST_MESSAGE); 698 // This may occur when destruction of the sender provider overtakes
699 // postMessage() because of thread hopping on WebServiceWorkerImpl.
699 return; 700 return;
700 } 701 }
701 702
702 DispatchExtendableMessageEvent( 703 DispatchExtendableMessageEvent(
703 make_scoped_refptr(handle->version()), message, source_origin, 704 make_scoped_refptr(handle->version()), message, source_origin,
704 sent_message_ports, sender_provider_host, 705 sent_message_ports, sender_provider_host,
705 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); 706 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback));
706 } 707 }
707 708
708 void ServiceWorkerDispatcherHost::DispatchExtendableMessageEvent( 709 void ServiceWorkerDispatcherHost::DispatchExtendableMessageEvent(
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
1405 if (!handle) { 1406 if (!handle) {
1406 bad_message::ReceivedBadMessage(this, 1407 bad_message::ReceivedBadMessage(this,
1407 bad_message::SWDH_TERMINATE_BAD_HANDLE); 1408 bad_message::SWDH_TERMINATE_BAD_HANDLE);
1408 return; 1409 return;
1409 } 1410 }
1410 handle->version()->StopWorker( 1411 handle->version()->StopWorker(
1411 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); 1412 base::Bind(&ServiceWorkerUtils::NoOpStatusCallback));
1412 } 1413 }
1413 1414
1414 } // namespace content 1415 } // 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