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

Unified Diff: chrome/browser/importer/profile_import_process_messages.h

Issue 18064002: The browser importer code which runs in the utility process should not depend on chrome\browser dat… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/importer/in_process_importer_bridge.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/importer/profile_import_process_messages.h
===================================================================
--- chrome/browser/importer/profile_import_process_messages.h (revision 208948)
+++ chrome/browser/importer/profile_import_process_messages.h (working copy)
@@ -197,84 +197,33 @@
}
}; // ParamTraits<ImportedFaviconUsage>
-// Traits for TemplateURLData
+// Traits for importer::URLKeywordInfo
template <>
-struct ParamTraits<TemplateURLData> {
- typedef TemplateURLData param_type;
+struct ParamTraits<importer::URLKeywordInfo> {
+ typedef importer::URLKeywordInfo param_type;
static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.short_name);
- WriteParam(m, p.keyword());
- WriteParam(m, p.url());
- WriteParam(m, p.suggestions_url);
- WriteParam(m, p.instant_url);
- WriteParam(m, p.favicon_url);
- WriteParam(m, p.originating_url);
- WriteParam(m, p.show_in_default_list);
- WriteParam(m, p.safe_for_autoreplace);
- WriteParam(m, p.input_encodings);
- WriteParam(m, p.id);
- WriteParam(m, p.date_created);
- WriteParam(m, p.last_modified);
- WriteParam(m, p.created_by_policy);
- WriteParam(m, p.usage_count);
- WriteParam(m, p.prepopulate_id);
- WriteParam(m, p.sync_guid);
+ WriteParam(m, p.url);
+ WriteParam(m, p.keyword);
+ WriteParam(m, p.display_name);
}
- static bool Read(const Message* m, PickleIterator* iter, param_type* p) {
- string16 keyword;
- std::string url;
- if (!ReadParam(m, iter, &p->short_name) ||
- !ReadParam(m, iter, &keyword) ||
- !ReadParam(m, iter, &url) ||
- !ReadParam(m, iter, &p->suggestions_url) ||
- !ReadParam(m, iter, &p->instant_url) ||
- !ReadParam(m, iter, &p->favicon_url) ||
- !ReadParam(m, iter, &p->originating_url) ||
- !ReadParam(m, iter, &p->show_in_default_list) ||
- !ReadParam(m, iter, &p->safe_for_autoreplace) ||
- !ReadParam(m, iter, &p->input_encodings) ||
- !ReadParam(m, iter, &p->id) ||
- !ReadParam(m, iter, &p->date_created) ||
- !ReadParam(m, iter, &p->last_modified) ||
- !ReadParam(m, iter, &p->created_by_policy) ||
- !ReadParam(m, iter, &p->usage_count) ||
- !ReadParam(m, iter, &p->prepopulate_id) ||
- !ReadParam(m, iter, &p->sync_guid))
- return false;
- p->SetKeyword(keyword);
- p->SetURL(url);
- return true;
- }
- static void Log(const param_type& p, std::string* l) {
- l->append("<TemplateURLData>");
- }
-};
-// Traits for TemplateURL*.
-// WARNING: These will cause us to allocate a new TemplateURL on the heap on the
-// receiver side. Any messages using this type must have handlers that are
-// careful to properly take ownership and avoid leaks! See warning below on
-// ProfileImportProcessHostMsg_NotifyKeywordsReady.
-template <>
-struct ParamTraits<TemplateURL*> {
- typedef TemplateURL* param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p->data());
- }
static bool Read(const Message* m, PickleIterator* iter, param_type* p) {
- TemplateURLData data;
- if (!ReadParam(m, iter, &data))
- return false;
- // Since we don't have access to a Profile*, just supply NULL. The caller
- // can create a new TemplateURL or modify this one (e.g. via
- // TemplateURLService::AddAndSetProfile()) to correct this later.
- *p = new TemplateURL(NULL, data);
- return true;
+ return
+ ReadParam(m, iter, &p->url) &&
+ ReadParam(m, iter, &p->keyword) &&
+ ReadParam(m, iter, &p->display_name);
}
+
static void Log(const param_type& p, std::string* l) {
- l->append("<TemplateURL*>");
+ l->append("(");
+ LogParam(p.url, l);
+ l->append(", ");
+ LogParam(p.keyword, l);
+ l->append(", ");
+ LogParam(p.display_name, l);
+ l->append(")");
}
-};
+}; // ParamTraits<importer::URLKeywordInfo>
} // namespace IPC
@@ -341,9 +290,10 @@
IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyPasswordFormReady,
content::PasswordForm)
-// WARNING: The TemplateURL*s in the following message get heap-allocated on the
-// receiving end. The message handler for this message MUST take ownership of
-// these pointers and ensure they're properly freed!
IPC_MESSAGE_CONTROL2(ProfileImportProcessHostMsg_NotifyKeywordsReady,
- std::vector<TemplateURL*>,
+ std::vector<importer::URLKeywordInfo>, // url_keywords
bool /* unique on host and path */)
+
+IPC_MESSAGE_CONTROL1(ProfileImportProcessHostMsg_NotifyFirefoxSearchEngData,
+ std::vector<std::string>) // search_engine_data
+
« no previous file with comments | « chrome/browser/importer/in_process_importer_bridge.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698