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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 190763008: Only notify V8 once per timezone change (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/render_view_impl.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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 372
373 // static 373 // static
374 Referrer RenderViewImpl::GetReferrerFromRequest( 374 Referrer RenderViewImpl::GetReferrerFromRequest(
375 WebFrame* frame, 375 WebFrame* frame,
376 const WebURLRequest& request) { 376 const WebURLRequest& request) {
377 return Referrer(GURL(request.httpHeaderField(WebString::fromUTF8("Referer"))), 377 return Referrer(GURL(request.httpHeaderField(WebString::fromUTF8("Referer"))),
378 request.referrerPolicy()); 378 request.referrerPolicy());
379 } 379 }
380 380
381 // static 381 // static
382 void RenderViewImpl::NotifyTimezoneChange(blink::WebFrame* frame) { 382 void RenderViewImpl::NotifyTimezoneChange() {
383 v8::HandleScope handle_scope(v8::Isolate::GetCurrent());
384 v8::Context::Scope context_scope(frame->mainWorldScriptContext());
385 v8::Date::DateTimeConfigurationChangeNotification(v8::Isolate::GetCurrent()); 383 v8::Date::DateTimeConfigurationChangeNotification(v8::Isolate::GetCurrent());
386 blink::WebFrame* child = frame->firstChild();
387 for (; child; child = child->nextSibling())
388 NotifyTimezoneChange(child);
389 } 384 }
390 385
391 // static 386 // static
392 WindowOpenDisposition RenderViewImpl::NavigationPolicyToDisposition( 387 WindowOpenDisposition RenderViewImpl::NavigationPolicyToDisposition(
393 WebNavigationPolicy policy) { 388 WebNavigationPolicy policy) {
394 switch (policy) { 389 switch (policy) {
395 case blink::WebNavigationPolicyIgnore: 390 case blink::WebNavigationPolicyIgnore:
396 return IGNORE_ACTION; 391 return IGNORE_ACTION;
397 case blink::WebNavigationPolicyDownload: 392 case blink::WebNavigationPolicyDownload:
398 return SAVE_TO_DISK; 393 return SAVE_TO_DISK;
(...skipping 3372 matching lines...) Expand 10 before | Expand all | Expand 10 after
3771 void RenderViewImpl::OnDragSourceSystemDragEnded() { 3766 void RenderViewImpl::OnDragSourceSystemDragEnded() {
3772 webview()->dragSourceSystemDragEnded(); 3767 webview()->dragSourceSystemDragEnded();
3773 } 3768 }
3774 3769
3775 void RenderViewImpl::OnUpdateWebPreferences(const WebPreferences& prefs) { 3770 void RenderViewImpl::OnUpdateWebPreferences(const WebPreferences& prefs) {
3776 webkit_preferences_ = prefs; 3771 webkit_preferences_ = prefs;
3777 ApplyWebPreferences(webkit_preferences_, webview()); 3772 ApplyWebPreferences(webkit_preferences_, webview());
3778 } 3773 }
3779 3774
3780 void RenderViewImpl::OnUpdateTimezone() { 3775 void RenderViewImpl::OnUpdateTimezone() {
3781 if (webview()) 3776 NotifyTimezoneChange();
3782 NotifyTimezoneChange(webview()->mainFrame());
3783 } 3777 }
3784 3778
3785 void RenderViewImpl::OnEnumerateDirectoryResponse( 3779 void RenderViewImpl::OnEnumerateDirectoryResponse(
3786 int id, 3780 int id,
3787 const std::vector<base::FilePath>& paths) { 3781 const std::vector<base::FilePath>& paths) {
3788 if (!enumeration_completions_[id]) 3782 if (!enumeration_completions_[id])
3789 return; 3783 return;
3790 3784
3791 WebVector<WebString> ws_file_names(paths.size()); 3785 WebVector<WebString> ws_file_names(paths.size());
3792 for (size_t i = 0; i < paths.size(); ++i) 3786 for (size_t i = 0; i < paths.size(); ++i)
(...skipping 1364 matching lines...) Expand 10 before | Expand all | Expand 10 after
5157 for (size_t i = 0; i < icon_urls.size(); i++) { 5151 for (size_t i = 0; i < icon_urls.size(); i++) {
5158 WebURL url = icon_urls[i].iconURL(); 5152 WebURL url = icon_urls[i].iconURL();
5159 if (!url.isEmpty()) 5153 if (!url.isEmpty())
5160 urls.push_back(FaviconURL(url, 5154 urls.push_back(FaviconURL(url,
5161 ToFaviconType(icon_urls[i].iconType()))); 5155 ToFaviconType(icon_urls[i].iconType())));
5162 } 5156 }
5163 SendUpdateFaviconURL(urls); 5157 SendUpdateFaviconURL(urls);
5164 } 5158 }
5165 5159
5166 } // namespace content 5160 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698