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

Side by Side Diff: chrome/browser/extensions/api/messaging/message_service.cc

Issue 240223004: When passing a user gesture along with a message, include the timestamp of the user gesture to prev… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | « no previous file | chrome/renderer/extensions/messaging_bindings.cc » ('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/browser/extensions/api/messaging/message_service.h" 5 #include "chrome/browser/extensions/api/messaging/message_service.h"
6 6
7 #include "base/atomic_sequence_num.h" 7 #include "base/atomic_sequence_num.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 // the channel opens. 559 // the channel opens.
560 EnqueuePendingMessage(source_port_id, channel_id, message); 560 EnqueuePendingMessage(source_port_id, channel_id, message);
561 return; 561 return;
562 } 562 }
563 563
564 DispatchMessage(source_port_id, iter->second, message); 564 DispatchMessage(source_port_id, iter->second, message);
565 } 565 }
566 566
567 void MessageService::PostMessageFromNativeProcess(int port_id, 567 void MessageService::PostMessageFromNativeProcess(int port_id,
568 const std::string& message) { 568 const std::string& message) {
569 PostMessage(port_id, Message(message, false /* user_gesture */)); 569 PostMessage(port_id, Message(message, false /* user_gesture */, 0.0));
570 } 570 }
571 571
572 void MessageService::Observe(int type, 572 void MessageService::Observe(int type,
573 const content::NotificationSource& source, 573 const content::NotificationSource& source,
574 const content::NotificationDetails& details) { 574 const content::NotificationDetails& details) {
575 switch (type) { 575 switch (type) {
576 case content::NOTIFICATION_RENDERER_PROCESS_TERMINATED: 576 case content::NOTIFICATION_RENDERER_PROCESS_TERMINATED:
577 case content::NOTIFICATION_RENDERER_PROCESS_CLOSED: { 577 case content::NOTIFICATION_RENDERER_PROCESS_CLOSED: {
578 content::RenderProcessHost* renderer = 578 content::RenderProcessHost* renderer =
579 content::Source<content::RenderProcessHost>(source).ptr(); 579 content::Source<content::RenderProcessHost>(source).ptr();
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 } 757 }
758 758
759 void MessageService::DispatchOnDisconnect(content::RenderProcessHost* source, 759 void MessageService::DispatchOnDisconnect(content::RenderProcessHost* source,
760 int port_id, 760 int port_id,
761 const std::string& error_message) { 761 const std::string& error_message) {
762 ExtensionMessagePort port(source, MSG_ROUTING_CONTROL, ""); 762 ExtensionMessagePort port(source, MSG_ROUTING_CONTROL, "");
763 port.DispatchOnDisconnect(GET_OPPOSITE_PORT_ID(port_id), error_message); 763 port.DispatchOnDisconnect(GET_OPPOSITE_PORT_ID(port_id), error_message);
764 } 764 }
765 765
766 } // namespace extensions 766 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/extensions/messaging_bindings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698