| 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/renderer/extensions/dispatcher.h" | 5 #include "chrome/renderer/extensions/dispatcher.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/alias.h" | 9 #include "base/debug/alias.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 const base::DictionaryValue& source_tab, | 588 const base::DictionaryValue& source_tab, |
| 589 const ExtensionMsg_ExternalConnectionInfo& info) { | 589 const ExtensionMsg_ExternalConnectionInfo& info) { |
| 590 MiscellaneousBindings::DispatchOnConnect( | 590 MiscellaneousBindings::DispatchOnConnect( |
| 591 v8_context_set_.GetAll(), | 591 v8_context_set_.GetAll(), |
| 592 target_port_id, channel_name, source_tab, | 592 target_port_id, channel_name, source_tab, |
| 593 info.source_id, info.target_id, info.source_url, | 593 info.source_id, info.target_id, info.source_url, |
| 594 NULL); // All render views. | 594 NULL); // All render views. |
| 595 } | 595 } |
| 596 | 596 |
| 597 void Dispatcher::OnDeliverMessage(int target_port_id, | 597 void Dispatcher::OnDeliverMessage(int target_port_id, |
| 598 const std::string& message) { | 598 const base::ListValue& message) { |
| 599 MiscellaneousBindings::DeliverMessage( | 599 MiscellaneousBindings::DeliverMessage( |
| 600 v8_context_set_.GetAll(), | 600 v8_context_set_.GetAll(), |
| 601 target_port_id, | 601 target_port_id, |
| 602 message, | 602 message, |
| 603 NULL); // All render views. | 603 NULL); // All render views. |
| 604 } | 604 } |
| 605 | 605 |
| 606 void Dispatcher::OnDispatchOnDisconnect(int port_id, | 606 void Dispatcher::OnDispatchOnDisconnect(int port_id, |
| 607 const std::string& error_message) { | 607 const std::string& error_message) { |
| 608 MiscellaneousBindings::DispatchOnDisconnect( | 608 MiscellaneousBindings::DispatchOnDisconnect( |
| (...skipping 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1458 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); | 1458 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); |
| 1459 v8::ThrowException( | 1459 v8::ThrowException( |
| 1460 v8::Exception::Error(v8::String::New(error_msg.c_str()))); | 1460 v8::Exception::Error(v8::String::New(error_msg.c_str()))); |
| 1461 return false; | 1461 return false; |
| 1462 } | 1462 } |
| 1463 | 1463 |
| 1464 return true; | 1464 return true; |
| 1465 } | 1465 } |
| 1466 | 1466 |
| 1467 } // namespace extensions | 1467 } // namespace extensions |
| OLD | NEW |