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

Side by Side Diff: chrome/renderer/extensions/dispatcher.cc

Issue 16226004: Replace JSON (de)serialization of extension messages with direct Value pickling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/extensions/dispatcher.h ('k') | chrome/renderer/extensions/extension_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 const base::DictionaryValue& source_tab, 584 const base::DictionaryValue& source_tab,
585 const ExtensionMsg_ExternalConnectionInfo& info) { 585 const ExtensionMsg_ExternalConnectionInfo& info) {
586 MiscellaneousBindings::DispatchOnConnect( 586 MiscellaneousBindings::DispatchOnConnect(
587 v8_context_set_.GetAll(), 587 v8_context_set_.GetAll(),
588 target_port_id, channel_name, source_tab, 588 target_port_id, channel_name, source_tab,
589 info.source_id, info.target_id, info.source_url, 589 info.source_id, info.target_id, info.source_url,
590 NULL); // All render views. 590 NULL); // All render views.
591 } 591 }
592 592
593 void Dispatcher::OnDeliverMessage(int target_port_id, 593 void Dispatcher::OnDeliverMessage(int target_port_id,
594 const std::string& message) { 594 const base::ListValue& message) {
595 MiscellaneousBindings::DeliverMessage( 595 MiscellaneousBindings::DeliverMessage(
596 v8_context_set_.GetAll(), 596 v8_context_set_.GetAll(),
597 target_port_id, 597 target_port_id,
598 message, 598 message,
599 NULL); // All render views. 599 NULL); // All render views.
600 } 600 }
601 601
602 void Dispatcher::OnDispatchOnDisconnect(int port_id, 602 void Dispatcher::OnDispatchOnDisconnect(int port_id,
603 const std::string& error_message) { 603 const std::string& error_message) {
604 MiscellaneousBindings::DispatchOnDisconnect( 604 MiscellaneousBindings::DispatchOnDisconnect(
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
1453 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); 1453 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str());
1454 v8::ThrowException( 1454 v8::ThrowException(
1455 v8::Exception::Error(v8::String::New(error_msg.c_str()))); 1455 v8::Exception::Error(v8::String::New(error_msg.c_str())));
1456 return false; 1456 return false;
1457 } 1457 }
1458 1458
1459 return true; 1459 return true;
1460 } 1460 }
1461 1461
1462 } // namespace extensions 1462 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/dispatcher.h ('k') | chrome/renderer/extensions/extension_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698