OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/extensions/extension_message_service.h" | 5 #include "chrome/browser/extensions/extension_message_service.h" |
6 | 6 |
7 #include "base/atomic_sequence_num.h" | 7 #include "base/atomic_sequence_num.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 } | 435 } |
436 } | 436 } |
437 | 437 |
438 return false; | 438 return false; |
439 } | 439 } |
440 | 440 |
441 void ExtensionMessageService::PendingOpenChannel( | 441 void ExtensionMessageService::PendingOpenChannel( |
442 const OpenChannelParams& params_in, | 442 const OpenChannelParams& params_in, |
443 int source_process_id, | 443 int source_process_id, |
444 ExtensionHost* host) { | 444 ExtensionHost* host) { |
| 445 if (!host) |
| 446 return; // TODO(mpcomplete): notify source of disconnect? |
| 447 |
445 // Re-lookup the source process since it may no longer be valid. | 448 // Re-lookup the source process since it may no longer be valid. |
446 OpenChannelParams params = params_in; | 449 OpenChannelParams params = params_in; |
447 params.source = content::RenderProcessHost::FromID(source_process_id); | 450 params.source = content::RenderProcessHost::FromID(source_process_id); |
448 if (!params.source) | 451 if (!params.source) |
449 return; | 452 return; |
450 | 453 |
451 params.receiver = MessagePort(host->render_process_host(), | 454 params.receiver = MessagePort(host->render_process_host(), |
452 MSG_ROUTING_CONTROL); | 455 MSG_ROUTING_CONTROL); |
453 OpenChannelImpl(params); | 456 OpenChannelImpl(params); |
454 } | 457 } |
OLD | NEW |