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

Side by Side Diff: chrome/renderer/extensions/extension_helper.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
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/extension_helper.h" 5 #include "chrome/renderer/extensions/extension_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/json/json_string_value_serializer.h" 10 #include "base/json/json_string_value_serializer.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 const std::string& channel_name, 267 const std::string& channel_name,
268 const base::DictionaryValue& source_tab, 268 const base::DictionaryValue& source_tab,
269 const ExtensionMsg_ExternalConnectionInfo& info) { 269 const ExtensionMsg_ExternalConnectionInfo& info) {
270 MiscellaneousBindings::DispatchOnConnect( 270 MiscellaneousBindings::DispatchOnConnect(
271 dispatcher_->v8_context_set().GetAll(), 271 dispatcher_->v8_context_set().GetAll(),
272 target_port_id, channel_name, source_tab, 272 target_port_id, channel_name, source_tab,
273 info.source_id, info.target_id, info.source_url, 273 info.source_id, info.target_id, info.source_url,
274 render_view()); 274 render_view());
275 } 275 }
276 276
277 void ExtensionHelper::OnExtensionDeliverMessage(int target_id, 277 void ExtensionHelper::OnExtensionDeliverMessage(
278 const std::string& message) { 278 int target_id,
279 const base::ListValue& message) {
279 MiscellaneousBindings::DeliverMessage(dispatcher_->v8_context_set().GetAll(), 280 MiscellaneousBindings::DeliverMessage(dispatcher_->v8_context_set().GetAll(),
280 target_id, 281 target_id,
281 message, 282 message,
282 render_view()); 283 render_view());
283 } 284 }
284 285
285 void ExtensionHelper::OnExtensionDispatchOnDisconnect( 286 void ExtensionHelper::OnExtensionDispatchOnDisconnect(
286 int port_id, 287 int port_id,
287 const std::string& error_message) { 288 const std::string& error_message) {
288 MiscellaneousBindings::DispatchOnDisconnect( 289 MiscellaneousBindings::DispatchOnDisconnect(
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 v8::Handle<v8::Context> script_context = 361 v8::Handle<v8::Context> script_context =
361 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext(); 362 render_view()->GetWebView()->mainFrame()->mainWorldScriptContext();
362 ChromeV8Context* chrome_v8_context = 363 ChromeV8Context* chrome_v8_context =
363 dispatcher_->v8_context_set().GetByV8Context(script_context); 364 dispatcher_->v8_context_set().GetByV8Context(script_context);
364 if (!chrome_v8_context) 365 if (!chrome_v8_context)
365 return; 366 return;
366 chrome_v8_context->CallChromeHiddenMethod("OnAppWindowClosed", 0, NULL, NULL); 367 chrome_v8_context->CallChromeHiddenMethod("OnAppWindowClosed", 0, NULL, NULL);
367 } 368 }
368 369
369 } // namespace extensions 370 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/extension_helper.h ('k') | chrome/renderer/extensions/miscellaneous_bindings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698