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

Unified Diff: ppapi/shared_impl/ppb_url_request_info_shared.cc

Issue 10762017: PPAPI: Add an API for setting a custom user agent for URL requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: foo Created 8 years, 5 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 | « ppapi/shared_impl/ppb_url_request_info_shared.h ('k') | ppapi/tests/test_url_request.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/ppb_url_request_info_shared.cc
diff --git a/ppapi/shared_impl/ppb_url_request_info_shared.cc b/ppapi/shared_impl/ppb_url_request_info_shared.cc
index d7a3ea211746ba8f2922140b95158d8542e31728..058b2be0be5f71c1e9103717a92f62028d1dbc58 100644
--- a/ppapi/shared_impl/ppb_url_request_info_shared.cc
+++ b/ppapi/shared_impl/ppb_url_request_info_shared.cc
@@ -62,6 +62,8 @@ PPB_URLRequestInfo_Data::PPB_URLRequestInfo_Data()
allow_credentials(false),
has_custom_content_transfer_encoding(false),
custom_content_transfer_encoding(),
+ has_custom_user_agent(false),
+ custom_user_agent(),
prefetch_buffer_upper_threshold(kDefaultPrefetchBufferUpperThreshold),
prefetch_buffer_lower_threshold(kDefaultPrefetchBufferLowerThreshold),
body() {
@@ -181,6 +183,10 @@ bool PPB_URLRequestInfo_Shared::SetUndefinedProperty(
data_.has_custom_content_transfer_encoding = false;
data_.custom_content_transfer_encoding = std::string();
return true;
+ case PP_URLREQUESTPROPERTY_CUSTOMUSERAGENT:
+ data_.has_custom_user_agent = false;
+ data_.custom_user_agent = std::string();
+ return true;
default:
return false;
}
@@ -258,6 +264,10 @@ bool PPB_URLRequestInfo_Shared::SetStringProperty(
data_.has_custom_content_transfer_encoding = true;
data_.custom_content_transfer_encoding = value;
return true;
+ case PP_URLREQUESTPROPERTY_CUSTOMUSERAGENT:
+ data_.has_custom_user_agent = true;
+ data_.custom_user_agent = value;
+ return true;
default:
return false;
}
« no previous file with comments | « ppapi/shared_impl/ppb_url_request_info_shared.h ('k') | ppapi/tests/test_url_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698