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

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

Issue 823703004: Tracking push events for lucid sleep (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Kill renderer if it sends a bad message id Created 5 years, 10 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/dispatcher.h" 5 #include "extensions/renderer/dispatcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 495
496 // Tell the browser process when an event has been dispatched with a lazy 496 // Tell the browser process when an event has been dispatched with a lazy
497 // background page active. 497 // background page active.
498 const Extension* extension = extensions_.GetByID(extension_id); 498 const Extension* extension = extensions_.GetByID(extension_id);
499 if (extension && BackgroundInfo::HasLazyBackgroundPage(extension) && 499 if (extension && BackgroundInfo::HasLazyBackgroundPage(extension) &&
500 module_name == kEventBindings && 500 module_name == kEventBindings &&
501 function_name == kEventDispatchFunction) { 501 function_name == kEventDispatchFunction) {
502 RenderView* background_view = 502 RenderView* background_view =
503 ExtensionHelper::GetBackgroundPage(extension_id); 503 ExtensionHelper::GetBackgroundPage(extension_id);
504 if (background_view) { 504 if (background_view) {
505 background_view->Send( 505 int message_id;
506 new ExtensionHostMsg_EventAck(background_view->GetRoutingID())); 506 args.GetInteger(3, &message_id);
507 background_view->Send(new ExtensionHostMsg_EventAck(
508 background_view->GetRoutingID(), message_id));
507 } 509 }
508 } 510 }
509 } 511 }
510 512
511 void Dispatcher::ClearPortData(int port_id) { 513 void Dispatcher::ClearPortData(int port_id) {
512 // Only the target port side has entries in |port_to_tab_id_map_|. If 514 // Only the target port side has entries in |port_to_tab_id_map_|. If
513 // |port_id| is a source port, std::map::erase() will just silently fail 515 // |port_id| is a source port, std::map::erase() will just silently fail
514 // here as a no-op. 516 // here as a no-op.
515 port_to_tab_id_map_.erase(port_id); 517 port_to_tab_id_map_.erase(port_id);
516 } 518 }
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 return v8::Handle<v8::Object>(); 1430 return v8::Handle<v8::Object>();
1429 1431
1430 if (bind_name) 1432 if (bind_name)
1431 *bind_name = split.back(); 1433 *bind_name = split.back();
1432 1434
1433 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) 1435 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context))
1434 : bind_object; 1436 : bind_object;
1435 } 1437 }
1436 1438
1437 } // namespace extensions 1439 } // namespace extensions
OLDNEW
« extensions/browser/extension_host.cc ('K') | « extensions/extensions.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698