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

Unified Diff: chrome/browser/dom_ui/dom_ui.cc

Issue 6286068: Reland 73532. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/dom_ui/dom_ui.h ('k') | chrome/browser/dom_ui/dom_ui_browsertest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/dom_ui.cc
===================================================================
--- chrome/browser/dom_ui/dom_ui.cc (revision 73540)
+++ chrome/browser/dom_ui/dom_ui.cc (working copy)
@@ -126,7 +126,12 @@
void DOMUI::RegisterMessageCallback(const std::string &message,
MessageCallback *callback) {
- message_callbacks_.insert(std::make_pair(message, callback));
+ std::pair<MessageCallbackMap::iterator, bool> result =
+ message_callbacks_.insert(std::make_pair(message, callback));
+
+ // Overwrite preexisting message callback mappings.
+ if (register_callback_overwrites() && !result.second)
+ result.first->second = callback;
}
Profile* DOMUI::GetProfile() const {
« no previous file with comments | « chrome/browser/dom_ui/dom_ui.h ('k') | chrome/browser/dom_ui/dom_ui_browsertest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698