| 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); |
| 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 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1422 return v8::Handle<v8::Object>(); | 1424 return v8::Handle<v8::Object>(); |
| 1423 | 1425 |
| 1424 if (bind_name) | 1426 if (bind_name) |
| 1425 *bind_name = split.back(); | 1427 *bind_name = split.back(); |
| 1426 | 1428 |
| 1427 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) | 1429 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) |
| 1428 : bind_object; | 1430 : bind_object; |
| 1429 } | 1431 } |
| 1430 | 1432 |
| 1431 } // namespace extensions | 1433 } // namespace extensions |
| OLD | NEW |