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

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

Issue 1401813002: Cache User Agent string in BlinkPlatformImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moved to FrameLoaderClientImpl 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 unified diff | Download patch
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 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 m_webFrame->client()->didCreateDataSource(m_webFrame, ds.get()); 679 m_webFrame->client()->didCreateDataSource(m_webFrame, ds.get());
680 return ds.release(); 680 return ds.release();
681 } 681 }
682 682
683 String FrameLoaderClientImpl::userAgent() 683 String FrameLoaderClientImpl::userAgent()
684 { 684 {
685 WebString override = m_webFrame->client()->userAgentOverride(m_webFrame); 685 WebString override = m_webFrame->client()->userAgentOverride(m_webFrame);
686 if (!override.isEmpty()) 686 if (!override.isEmpty())
687 return override; 687 return override;
688 688
689 return Platform::current()->userAgent(); 689 if (m_userAgent.isNull())
690 m_userAgent = Platform::current()->userAgent();
kinuko 2015/10/16 11:12:21 Maybe add a comment in Platform.h to note that the
tzik 2015/10/19 08:16:48 Done.
691 return m_userAgent;
690 } 692 }
691 693
692 String FrameLoaderClientImpl::doNotTrackValue() 694 String FrameLoaderClientImpl::doNotTrackValue()
693 { 695 {
694 WebString doNotTrack = m_webFrame->client()->doNotTrackValue(m_webFrame); 696 WebString doNotTrack = m_webFrame->client()->doNotTrackValue(m_webFrame);
695 if (!doNotTrack.isEmpty()) 697 if (!doNotTrack.isEmpty())
696 return doNotTrack; 698 return doNotTrack;
697 return String(); 699 return String();
698 } 700 }
699 701
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 958
957 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde nTerminationDisablerType type) 959 void FrameLoaderClientImpl::suddenTerminationDisablerChanged(bool present, Sudde nTerminationDisablerType type)
958 { 960 {
959 if (m_webFrame->client()) { 961 if (m_webFrame->client()) {
960 m_webFrame->client()->suddenTerminationDisablerChanged( 962 m_webFrame->client()->suddenTerminationDisablerChanged(
961 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>( type)); 963 present, static_cast<WebFrameClient::SuddenTerminationDisablerType>( type));
962 } 964 }
963 } 965 }
964 966
965 } // namespace blink 967 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698