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

Side by Side Diff: chrome/renderer/extensions/resource_request_policy.cc

Issue 1773813007: blink: Rename modules/ method to prefix with get when they collide. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clash-modules: rebase-fixes Created 4 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
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 "chrome/renderer/extensions/resource_request_policy.h" 5 #include "chrome/renderer/extensions/resource_request_policy.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "chrome/common/extensions/chrome_manifest_url_handlers.h" 9 #include "chrome/common/extensions/chrome_manifest_url_handlers.h"
10 #include "chrome/common/url_constants.h" 10 #include "chrome/common/url_constants.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 extension, resource_url.path()) && 69 extension, resource_url.path()) &&
70 !WebviewInfo::IsResourceWebviewAccessible( 70 !WebviewInfo::IsResourceWebviewAccessible(
71 extension, dispatcher_->webview_partition_id(), 71 extension, dispatcher_->webview_partition_id(),
72 resource_url.path())) { 72 resource_url.path())) {
73 GURL frame_url = frame->document().url(); 73 GURL frame_url = frame->document().url();
74 74
75 // The page_origin may be GURL("null") for unique origins like data URLs, 75 // The page_origin may be GURL("null") for unique origins like data URLs,
76 // but this is ok for the checks below. We only care if it matches the 76 // but this is ok for the checks below. We only care if it matches the
77 // current extension or has a devtools scheme. 77 // current extension or has a devtools scheme.
78 GURL page_origin = 78 GURL page_origin =
79 blink::WebStringToGURL(frame->top()->securityOrigin().toString()); 79 blink::WebStringToGURL(frame->top()->getSecurityOrigin().toString());
80 80
81 // Exceptions are: 81 // Exceptions are:
82 // - empty origin (needed for some edge cases when we have empty origins) 82 // - empty origin (needed for some edge cases when we have empty origins)
83 bool is_empty_origin = frame_url.is_empty(); 83 bool is_empty_origin = frame_url.is_empty();
84 // - extensions requesting their own resources (frame_url check is for 84 // - extensions requesting their own resources (frame_url check is for
85 // images, page_url check is for iframes) 85 // images, page_url check is for iframes)
86 bool is_own_resource = frame_url.GetOrigin() == extension->url() || 86 bool is_own_resource = frame_url.GetOrigin() == extension->url() ||
87 page_origin == extension->url(); 87 page_origin == extension->url();
88 // - devtools (chrome-extension:// URLs are loaded into frames of devtools 88 // - devtools (chrome-extension:// URLs are loaded into frames of devtools
89 // to support the devtools extension APIs) 89 // to support the devtools extension APIs)
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 frame->addMessageToConsole( 127 frame->addMessageToConsole(
128 blink::WebConsoleMessage(blink::WebConsoleMessage::LevelError, 128 blink::WebConsoleMessage(blink::WebConsoleMessage::LevelError,
129 blink::WebString::fromUTF8(message))); 129 blink::WebString::fromUTF8(message)));
130 return false; 130 return false;
131 } 131 }
132 132
133 return true; 133 return true;
134 } 134 }
135 135
136 } // namespace extensions 136 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/media_galleries_custom_bindings.cc ('k') | chrome/renderer/plugins/chrome_plugin_placeholder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698