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

Unified Diff: chrome/browser/chrome_to_mobile_service.cc

Issue 15076008: Move AddMultipartValueForUpload to net/base/mime_util.h/cc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 7 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 | « no previous file | chrome/common/cloud_print/cloud_print_helpers.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_to_mobile_service.cc
diff --git a/chrome/browser/chrome_to_mobile_service.cc b/chrome/browser/chrome_to_mobile_service.cc
index 1f9e2f9fb8c0f4f9c66b14473ad0eba460124fcb..dfb42f79ea008b10a5c2674fcbefe47a081ffabc 100644
--- a/chrome/browser/chrome_to_mobile_service.cc
+++ b/chrome/browser/chrome_to_mobile_service.cc
@@ -45,6 +45,7 @@
#include "google_apis/gaia/oauth2_access_token_fetcher.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
+#include "net/base/mime_util.h"
#include "net/http/http_status_code.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_context_getter.h"
@@ -137,13 +138,13 @@ std::string GetContentType(ChromeToMobileService::JobType type) {
"multipart/related" : "text/plain";
}
-// Utility function to call cloud_print::AddMultipartValueForUpload.
+// Utility function to call net::AddMultipartValueForUpload.
void AddValue(const std::string& value_name,
const std::string& value,
const std::string& mime_boundary,
std::string* post_data) {
- cloud_print::AddMultipartValueForUpload(value_name, value, mime_boundary,
- std::string(), post_data);
+ net::AddMultipartValueForUpload(value_name, value, mime_boundary,
+ std::string(), post_data);
}
// Append the Chrome To Mobile client query parameter, used by cloud print.
@@ -583,10 +584,10 @@ void ChromeToMobileService::SendJobRequest(base::WeakPtr<Observer> observer,
AddValue("contentType", GetContentType(data.type), bound, &post);
// Add the snapshot or use dummy content to workaround a URL submission error.
- cloud_print::AddMultipartValueForUpload("content",
+ net::AddMultipartValueForUpload("content",
data.snapshot_content.empty() ? "content" : data.snapshot_content,
bound, "text/mhtml", &post);
- post.append("--" + bound + "--\r\n");
+ net::AddMultipartFinalDelimiterForUpload(bound, &post);
LogMetric(data.type == SNAPSHOT ? SENDING_SNAPSHOT : SENDING_URL);
net::URLFetcher* request = net::URLFetcher::Create(
« no previous file with comments | « no previous file | chrome/common/cloud_print/cloud_print_helpers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698