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 "extensions/browser/event_router.h" | 5 #include "extensions/browser/event_router.h" |
6 | 6 |
| 7 #include <tuple> |
7 #include <utility> | 8 #include <utility> |
8 | 9 |
9 #include "base/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
10 #include "base/bind.h" | 11 #include "base/bind.h" |
11 #include "base/command_line.h" | 12 #include "base/command_line.h" |
12 #include "base/lazy_instance.h" | 13 #include "base/lazy_instance.h" |
13 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
14 #include "base/metrics/histogram_macros.h" | 15 #include "base/metrics/histogram_macros.h" |
15 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
16 #include "base/values.h" | 17 #include "base/values.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 89 |
89 struct EventRouter::ListenerProcess { | 90 struct EventRouter::ListenerProcess { |
90 content::RenderProcessHost* process; | 91 content::RenderProcessHost* process; |
91 std::string extension_id; | 92 std::string extension_id; |
92 | 93 |
93 ListenerProcess(content::RenderProcessHost* process, | 94 ListenerProcess(content::RenderProcessHost* process, |
94 const std::string& extension_id) | 95 const std::string& extension_id) |
95 : process(process), extension_id(extension_id) {} | 96 : process(process), extension_id(extension_id) {} |
96 | 97 |
97 bool operator<(const ListenerProcess& that) const { | 98 bool operator<(const ListenerProcess& that) const { |
98 if (process < that.process) | 99 return std::tie(process, extension_id) < |
99 return true; | 100 std::tie(that.process, that.extension_id); |
100 if (process == that.process && extension_id < that.extension_id) | |
101 return true; | |
102 return false; | |
103 } | 101 } |
104 }; | 102 }; |
105 | 103 |
106 // static | 104 // static |
107 void EventRouter::DispatchExtensionMessage(IPC::Sender* ipc_sender, | 105 void EventRouter::DispatchExtensionMessage(IPC::Sender* ipc_sender, |
108 void* browser_context_id, | 106 void* browser_context_id, |
109 const std::string& extension_id, | 107 const std::string& extension_id, |
110 int event_id, | 108 int event_id, |
111 const std::string& event_name, | 109 const std::string& event_name, |
112 ListValue* event_args, | 110 ListValue* event_args, |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 const std::string& extension_id, | 902 const std::string& extension_id, |
905 const GURL& listener_url, | 903 const GURL& listener_url, |
906 content::BrowserContext* browser_context) | 904 content::BrowserContext* browser_context) |
907 : event_name(event_name), | 905 : event_name(event_name), |
908 extension_id(extension_id), | 906 extension_id(extension_id), |
909 listener_url(listener_url), | 907 listener_url(listener_url), |
910 browser_context(browser_context) { | 908 browser_context(browser_context) { |
911 } | 909 } |
912 | 910 |
913 } // namespace extensions | 911 } // namespace extensions |
OLD | NEW |