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

Side by Side Diff: extensions/renderer/extension_frame_helper.cc

Issue 2495213007: [Extensions] Use a separate IPC message for extension events (Closed)
Patch Set: lazyboys Created 4 years, 1 month 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
« no previous file with comments | « extensions/renderer/extension_frame_helper.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/extension_frame_helper.h" 5 #include "extensions/renderer/extension_frame_helper.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/timer/elapsed_timer.h" 9 #include "base/timer/elapsed_timer.h"
10 #include "content/public/renderer/render_frame.h" 10 #include "content/public/renderer/render_frame.h"
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 extension_dispatcher_->OnExtensionResponse(request_id, 372 extension_dispatcher_->OnExtensionResponse(request_id,
373 success, 373 success,
374 response, 374 response,
375 error); 375 error);
376 } 376 }
377 377
378 void ExtensionFrameHelper::OnExtensionMessageInvoke( 378 void ExtensionFrameHelper::OnExtensionMessageInvoke(
379 const std::string& extension_id, 379 const std::string& extension_id,
380 const std::string& module_name, 380 const std::string& module_name,
381 const std::string& function_name, 381 const std::string& function_name,
382 const base::ListValue& args, 382 const base::ListValue& args) {
383 bool user_gesture) { 383 extension_dispatcher_->InvokeModuleSystemMethod(
384 extension_dispatcher_->InvokeModuleSystemMethod(render_frame(), extension_id, 384 render_frame(), extension_id, module_name, function_name, args);
385 module_name, function_name,
386 args, user_gesture);
387 } 385 }
388 386
389 void ExtensionFrameHelper::OnAssignPortId(int port_id, int request_id) { 387 void ExtensionFrameHelper::OnAssignPortId(int port_id, int request_id) {
390 auto iter = pending_port_requests_.find(request_id); 388 auto iter = pending_port_requests_.find(request_id);
391 DCHECK(iter != pending_port_requests_.end()); 389 DCHECK(iter != pending_port_requests_.end());
392 PendingPortRequest& request = *iter->second; 390 PendingPortRequest& request = *iter->second;
393 switch (request.type) { 391 switch (request.type) {
394 case PortType::EXTENSION: { 392 case PortType::EXTENSION: {
395 UMA_HISTOGRAM_TIMES("Extensions.Messaging.GetPortIdAsyncTime.Extension", 393 UMA_HISTOGRAM_TIMES("Extensions.Messaging.GetPortIdAsyncTime.Extension",
396 request.timer.Elapsed()); 394 request.timer.Elapsed());
(...skipping 12 matching lines...) Expand all
409 } 407 }
410 request.callback.Run(port_id); 408 request.callback.Run(port_id);
411 pending_port_requests_.erase(iter); 409 pending_port_requests_.erase(iter);
412 } 410 }
413 411
414 void ExtensionFrameHelper::OnDestruct() { 412 void ExtensionFrameHelper::OnDestruct() {
415 delete this; 413 delete this;
416 } 414 }
417 415
418 } // namespace extensions 416 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/extension_frame_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698