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

Unified Diff: content/child/blink_platform_impl.cc

Issue 1401813002: Cache User Agent string in BlinkPlatformImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: +comment. +DCHECK Created 5 years, 2 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 | content/public/common/content_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/blink_platform_impl.cc
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
index 1a1cc6781df243748829e2392f188715b1ae2923..135cc72342717fd22fb58c3a7dab3538991a069f 100644
--- a/content/child/blink_platform_impl.cc
+++ b/content/child/blink_platform_impl.cc
@@ -487,7 +487,12 @@ blink::WebSocketHandle* BlinkPlatformImpl::createWebSocketHandle() {
}
WebString BlinkPlatformImpl::userAgent() {
- return WebString::fromUTF8(GetContentClient()->GetUserAgent());
+ CR_DEFINE_STATIC_LOCAL(
+ blink::WebString, user_agent,
+ (blink::WebString::fromUTF8(GetContentClient()->GetUserAgent())));
+ DCHECK(user_agent ==
+ blink::WebString::fromUTF8(GetContentClient()->GetUserAgent()));
+ return user_agent;
}
WebData BlinkPlatformImpl::parseDataURL(const WebURL& url,
« no previous file with comments | « no previous file | content/public/common/content_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698