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

Side by Side Diff: third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp

Issue 1839023002: Cache user agent string in FrameLoaderClientImpl instead of BlinkPlatformImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/web/FrameLoaderClientImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 m_webFrame->client()->didCreateDataSource(m_webFrame, ds.get()); 741 m_webFrame->client()->didCreateDataSource(m_webFrame, ds.get());
742 return ds.release(); 742 return ds.release();
743 } 743 }
744 744
745 String FrameLoaderClientImpl::userAgent() 745 String FrameLoaderClientImpl::userAgent()
746 { 746 {
747 WebString override = m_webFrame->client()->userAgentOverride(); 747 WebString override = m_webFrame->client()->userAgentOverride();
748 if (!override.isEmpty()) 748 if (!override.isEmpty())
749 return override; 749 return override;
750 750
751 return Platform::current()->userAgent(); 751 if (m_userAgent.isEmpty())
752 m_userAgent = Platform::current()->userAgent();
753 return m_userAgent;
752 } 754 }
753 755
754 String FrameLoaderClientImpl::doNotTrackValue() 756 String FrameLoaderClientImpl::doNotTrackValue()
755 { 757 {
756 WebString doNotTrack = m_webFrame->client()->doNotTrackValue(); 758 WebString doNotTrack = m_webFrame->client()->doNotTrackValue();
757 if (!doNotTrack.isEmpty()) 759 if (!doNotTrack.isEmpty())
758 return doNotTrack; 760 return doNotTrack;
759 return String(); 761 return String();
760 } 762 }
761 763
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
1048 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>( type)); 1050 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>( type));
1049 } 1051 }
1050 } 1052 }
1051 1053
1052 PassOwnPtrWillBeRawPtr<LinkResource> FrameLoaderClientImpl::createServiceWorkerL inkResource(HTMLLinkElement* owner) 1054 PassOwnPtrWillBeRawPtr<LinkResource> FrameLoaderClientImpl::createServiceWorkerL inkResource(HTMLLinkElement* owner)
1053 { 1055 {
1054 return ServiceWorkerLinkResource::create(owner); 1056 return ServiceWorkerLinkResource::create(owner);
1055 } 1057 }
1056 1058
1057 } // namespace blink 1059 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/FrameLoaderClientImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698