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 #include "extensions/renderer/dispatcher.h" | 5 #include "extensions/renderer/dispatcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/alias.h" | 10 #include "base/debug/alias.h" |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
495 | 495 |
496 // Tell the browser process when an event has been dispatched with a lazy | 496 // Tell the browser process when an event has been dispatched with a lazy |
497 // background page active. | 497 // background page active. |
498 const Extension* extension = extensions_.GetByID(extension_id); | 498 const Extension* extension = extensions_.GetByID(extension_id); |
499 if (extension && BackgroundInfo::HasLazyBackgroundPage(extension) && | 499 if (extension && BackgroundInfo::HasLazyBackgroundPage(extension) && |
500 module_name == kEventBindings && | 500 module_name == kEventBindings && |
501 function_name == kEventDispatchFunction) { | 501 function_name == kEventDispatchFunction) { |
502 RenderView* background_view = | 502 RenderView* background_view = |
503 ExtensionHelper::GetBackgroundPage(extension_id); | 503 ExtensionHelper::GetBackgroundPage(extension_id); |
504 if (background_view) { | 504 if (background_view) { |
505 background_view->Send( | 505 int message_id; |
506 new ExtensionHostMsg_EventAck(background_view->GetRoutingID())); | 506 args.GetInteger(3, &message_id); |
not at google - send to devlin
2015/02/26 23:24:32
Can you assert that there actually is a message ID
| |
507 background_view->Send(new ExtensionHostMsg_EventAck( | |
508 background_view->GetRoutingID(), message_id)); | |
507 } | 509 } |
508 } | 510 } |
509 } | 511 } |
510 | 512 |
511 void Dispatcher::ClearPortData(int port_id) { | 513 void Dispatcher::ClearPortData(int port_id) { |
512 // Only the target port side has entries in |port_to_tab_id_map_|. If | 514 // Only the target port side has entries in |port_to_tab_id_map_|. If |
513 // |port_id| is a source port, std::map::erase() will just silently fail | 515 // |port_id| is a source port, std::map::erase() will just silently fail |
514 // here as a no-op. | 516 // here as a no-op. |
515 port_to_tab_id_map_.erase(port_id); | 517 port_to_tab_id_map_.erase(port_id); |
516 } | 518 } |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1428 return v8::Handle<v8::Object>(); | 1430 return v8::Handle<v8::Object>(); |
1429 | 1431 |
1430 if (bind_name) | 1432 if (bind_name) |
1431 *bind_name = split.back(); | 1433 *bind_name = split.back(); |
1432 | 1434 |
1433 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) | 1435 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) |
1434 : bind_object; | 1436 : bind_object; |
1435 } | 1437 } |
1436 | 1438 |
1437 } // namespace extensions | 1439 } // namespace extensions |
OLD | NEW |