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

Unified Diff: chrome/browser/ui/webui/print_preview/print_preview_data_source.cc

Issue 10873097: Merge 153342 - Print preview: Use an ID instead of memory pointer string in WebUI. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1229/src/
Patch Set: Created 8 years, 4 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
Index: chrome/browser/ui/webui/print_preview/print_preview_data_source.cc
===================================================================
--- chrome/browser/ui/webui/print_preview/print_preview_data_source.cc (revision 153583)
+++ chrome/browser/ui/webui/print_preview/print_preview_data_source.cc (working copy)
@@ -195,10 +195,14 @@
scoped_refptr<base::RefCountedBytes> data;
std::vector<std::string> url_substr;
base::SplitString(path, '/', &url_substr);
+ int preview_ui_id = -1;
int page_index = 0;
- if (url_substr.size() == 3 && base::StringToInt(url_substr[1], &page_index)) {
+ if (url_substr.size() == 3 &&
+ base::StringToInt(url_substr[0], &preview_ui_id),
+ base::StringToInt(url_substr[1], &page_index) &&
+ preview_ui_id >= 0) {
PrintPreviewDataService::GetInstance()->GetDataEntry(
- url_substr[0], page_index, &data);
+ preview_ui_id, page_index, &data);
}
if (data.get()) {
SendResponse(request_id, data);

Powered by Google App Engine
This is Rietveld 408576698