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

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

Issue 2382973002: Convert WebSecurityOrigin -> GURL without re-parsing the url (Closed)
Patch Set: rebase on #427122 Created 4 years, 1 month 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 // 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 #include <memory> 9 #include <memory>
10 10
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 #include "third_party/icu/source/common/unicode/uchar.h" 164 #include "third_party/icu/source/common/unicode/uchar.h"
165 #include "third_party/icu/source/common/unicode/uscript.h" 165 #include "third_party/icu/source/common/unicode/uscript.h"
166 #include "ui/base/clipboard/clipboard.h" 166 #include "ui/base/clipboard/clipboard.h"
167 #include "ui/base/ui_base_switches_util.h" 167 #include "ui/base/ui_base_switches_util.h"
168 #include "ui/events/latency_info.h" 168 #include "ui/events/latency_info.h"
169 #include "ui/gfx/geometry/point.h" 169 #include "ui/gfx/geometry/point.h"
170 #include "ui/gfx/geometry/rect.h" 170 #include "ui/gfx/geometry/rect.h"
171 #include "ui/gfx/geometry/rect_conversions.h" 171 #include "ui/gfx/geometry/rect_conversions.h"
172 #include "ui/gfx/geometry/size_conversions.h" 172 #include "ui/gfx/geometry/size_conversions.h"
173 #include "ui/gfx/native_widget_types.h" 173 #include "ui/gfx/native_widget_types.h"
174 #include "url/origin.h"
174 #include "url/url_constants.h" 175 #include "url/url_constants.h"
175 #include "v8/include/v8.h" 176 #include "v8/include/v8.h"
176 177
177 #if defined(OS_ANDROID) 178 #if defined(OS_ANDROID)
178 #include <cpu-features.h> 179 #include <cpu-features.h>
179 180
180 #include "base/android/build_info.h" 181 #include "base/android/build_info.h"
181 #include "content/renderer/android/address_detector.h" 182 #include "content/renderer/android/address_detector.h"
182 #include "content/renderer/android/content_detector.h" 183 #include "content/renderer/android/content_detector.h"
183 #include "content/renderer/android/disambiguation_popup_helper.h" 184 #include "content/renderer/android/disambiguation_popup_helper.h"
(...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after
1521 // 1522 //
1522 // TODO(alexmos): This works fine for regular origins but may break path 1523 // TODO(alexmos): This works fine for regular origins but may break path
1523 // matching for file URLs with OOP subframes that open popups. This should 1524 // matching for file URLs with OOP subframes that open popups. This should
1524 // be fixed by either moving this lookup to the browser process or removing 1525 // be fixed by either moving this lookup to the browser process or removing
1525 // path-based matching for file URLs from content settings. See 1526 // path-based matching for file URLs from content settings. See
1526 // https://crbug.com/466297. 1527 // https://crbug.com/466297.
1527 if (creator->top()->isWebLocalFrame()) { 1528 if (creator->top()->isWebLocalFrame()) {
1528 params->opener_top_level_frame_url = creator->top()->document().url(); 1529 params->opener_top_level_frame_url = creator->top()->document().url();
1529 } else { 1530 } else {
1530 params->opener_top_level_frame_url = 1531 params->opener_top_level_frame_url =
1531 blink::WebStringToGURL(creator->top()->getSecurityOrigin().toString()); 1532 url::Origin(creator->top()->getSecurityOrigin()).GetURL();
1532 } 1533 }
1533 1534
1534 GURL security_url(blink::WebStringToGURL( 1535 GURL security_url(
1535 creator->document().getSecurityOrigin().toString())); 1536 url::Origin(creator->document().getSecurityOrigin()).GetURL());
1536 if (!security_url.is_valid()) 1537 if (!security_url.is_valid())
1537 security_url = GURL(); 1538 security_url = GURL();
1538 params->opener_security_origin = security_url; 1539 params->opener_security_origin = security_url;
1539 params->opener_suppressed = suppress_opener; 1540 params->opener_suppressed = suppress_opener;
1540 params->disposition = NavigationPolicyToDisposition(policy); 1541 params->disposition = NavigationPolicyToDisposition(policy);
1541 if (!request.isNull()) { 1542 if (!request.isNull()) {
1542 params->target_url = request.url(); 1543 params->target_url = request.url();
1543 params->referrer = GetReferrerFromRequest(creator, request); 1544 params->referrer = GetReferrerFromRequest(creator, request);
1544 } 1545 }
1545 params->features = features; 1546 params->features = features;
(...skipping 1485 matching lines...) Expand 10 before | Expand all | Expand 10 after
3031 if (IsUseZoomForDSFEnabled()) { 3032 if (IsUseZoomForDSFEnabled()) {
3032 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); 3033 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_);
3033 } else { 3034 } else {
3034 webview()->setDeviceScaleFactor(device_scale_factor_); 3035 webview()->setDeviceScaleFactor(device_scale_factor_);
3035 } 3036 }
3036 webview()->settings()->setPreferCompositingToLCDTextEnabled( 3037 webview()->settings()->setPreferCompositingToLCDTextEnabled(
3037 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); 3038 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_));
3038 } 3039 }
3039 3040
3040 } // namespace content 3041 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.cc ('k') | content/renderer/shared_worker/embedded_shared_worker_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698