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

Unified Diff: content/public/browser/web_ui_data_source.h

Issue 2475593002: MD History: update (instead of re-create) data sources on sign in change (Closed)
Patch Set: old history as well Created 4 years, 1 month 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
Index: content/public/browser/web_ui_data_source.h
diff --git a/content/public/browser/web_ui_data_source.h b/content/public/browser/web_ui_data_source.h
index 5c278c5069feef7d60c6a1d02d061f78350f76c1..c5104d159d1a095cbe0bc48667d2ad2f1c835b50 100644
--- a/content/public/browser/web_ui_data_source.h
+++ b/content/public/browser/web_ui_data_source.h
@@ -7,6 +7,8 @@
#include <stdint.h>
Charlie Reis 2016/11/16 18:38:46 nit: No blank line?
+#include <memory>
+
#include "base/callback.h"
#include "base/strings/string16.h"
#include "content/common/content_export.h"
@@ -27,10 +29,18 @@ class WebUIDataSource {
CONTENT_EXPORT static WebUIDataSource* Create(const std::string& source_name);
- // Adds a WebUI data source to |browser_context|.
+ // Adds a WebUI data source to |browser_context|. TODO(dbeam): update this API
+ // to take a std::unique_ptr instead to make it clear that |source| can be
+ // destroyed and references should not be kept by callers. Use |Update()|
+ // if you need to change an existing data source.
CONTENT_EXPORT static void Add(BrowserContext* browser_context,
WebUIDataSource* source);
+ CONTENT_EXPORT static void Update(
Charlie Reis 2016/11/16 18:38:46 Please include comments for all methods in the pub
+ BrowserContext* browser_context,
+ const std::string& source_name,
+ std::unique_ptr<base::DictionaryValue> update);
+
// Adds a string keyed to its name to our dictionary.
virtual void AddString(const std::string& name,
const base::string16& value) = 0;

Powered by Google App Engine
This is Rietveld 408576698