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

Side by Side Diff: extensions/browser/api/web_request/web_request_api.cc

Issue 2937623002: [Extensions] Simplify EventFilteringInfo (Closed)
Patch Set: karan's Created 3 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
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 "extensions/browser/api/web_request/web_request_api.h" 5 #include "extensions/browser/api/web_request/web_request_api.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 EventRouter* event_router = EventRouter::Get(browser_context); 295 EventRouter* event_router = EventRouter::Get(browser_context);
296 296
297 EventFilteringInfo event_filtering_info; 297 EventFilteringInfo event_filtering_info;
298 298
299 events::HistogramValue histogram_value = events::UNKNOWN; 299 events::HistogramValue histogram_value = events::UNKNOWN;
300 std::string event_name; 300 std::string event_name;
301 // The instance ID uniquely identifies a <webview> instance within an embedder 301 // The instance ID uniquely identifies a <webview> instance within an embedder
302 // process. We use a filter here so that only event listeners for a particular 302 // process. We use a filter here so that only event listeners for a particular
303 // <webview> will fire. 303 // <webview> will fire.
304 if (is_web_view_guest) { 304 if (is_web_view_guest) {
305 event_filtering_info.SetInstanceID(is_web_view_guest); 305 event_filtering_info.instance_id = is_web_view_guest;
306 histogram_value = events::WEB_VIEW_INTERNAL_ON_MESSAGE; 306 histogram_value = events::WEB_VIEW_INTERNAL_ON_MESSAGE;
307 event_name = webview::kEventMessage; 307 event_name = webview::kEventMessage;
308 } else { 308 } else {
309 histogram_value = events::DECLARATIVE_WEB_REQUEST_ON_MESSAGE; 309 histogram_value = events::DECLARATIVE_WEB_REQUEST_ON_MESSAGE;
310 event_name = declarative_keys::kOnMessage; 310 event_name = declarative_keys::kOnMessage;
311 } 311 }
312 312
313 std::unique_ptr<Event> event(new Event( 313 std::unique_ptr<Event> event(new Event(
314 histogram_value, event_name, std::move(event_args), browser_context, 314 histogram_value, event_name, std::move(event_args), browser_context,
315 GURL(), EventRouter::USER_GESTURE_UNKNOWN, event_filtering_info)); 315 GURL(), EventRouter::USER_GESTURE_UNKNOWN, event_filtering_info));
(...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after
2447 // Since EventListeners are segmented by browser_context, check that 2447 // Since EventListeners are segmented by browser_context, check that
2448 // last, as it is exceedingly unlikely to be different. 2448 // last, as it is exceedingly unlikely to be different.
2449 return extension_id == that.extension_id && 2449 return extension_id == that.extension_id &&
2450 sub_event_name == that.sub_event_name && 2450 sub_event_name == that.sub_event_name &&
2451 web_view_instance_id == that.web_view_instance_id && 2451 web_view_instance_id == that.web_view_instance_id &&
2452 embedder_process_id == that.embedder_process_id && 2452 embedder_process_id == that.embedder_process_id &&
2453 browser_context == that.browser_context; 2453 browser_context == that.browser_context;
2454 } 2454 }
2455 2455
2456 } // namespace extensions 2456 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/menu_manager.cc ('k') | extensions/browser/event_listener_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698