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

Side by Side Diff: extensions/browser/extension_navigation_throttle.cc

Issue 2108623005: extensions: Change auto to not deduce raw pointers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "extensions/browser/extension_navigation_throttle.h" 5 #include "extensions/browser/extension_navigation_throttle.h"
6 6
7 #include "content/public/browser/browser_thread.h" 7 #include "content/public/browser/browser_thread.h"
8 #include "content/public/browser/navigation_handle.h" 8 #include "content/public/browser/navigation_handle.h"
9 #include "content/public/browser/render_frame_host.h" 9 #include "content/public/browser/render_frame_host.h"
10 #include "content/public/browser/web_contents.h" 10 #include "content/public/browser/web_contents.h"
(...skipping 26 matching lines...) Expand all
37 return content::NavigationThrottle::PROCEED; 37 return content::NavigationThrottle::PROCEED;
38 38
39 // The subframe which is navigated needs to have all of its ancestors be 39 // The subframe which is navigated needs to have all of its ancestors be
40 // at the same origin, otherwise the resource needs to be explicitly listed 40 // at the same origin, otherwise the resource needs to be explicitly listed
41 // in web_accessible_resources. 41 // in web_accessible_resources.
42 // Since the RenderFrameHost is not known until navigation has committed, 42 // Since the RenderFrameHost is not known until navigation has committed,
43 // we can't get it from NavigationHandle. However, this code only cares about 43 // we can't get it from NavigationHandle. However, this code only cares about
44 // the ancestor chain, so find the current RenderFrameHost and use it to 44 // the ancestor chain, so find the current RenderFrameHost and use it to
45 // traverse up to the main frame. 45 // traverse up to the main frame.
46 content::RenderFrameHost* navigating_frame = nullptr; 46 content::RenderFrameHost* navigating_frame = nullptr;
47 for (auto frame : navigation_handle()->GetWebContents()->GetAllFrames()) { 47 for (auto* frame : navigation_handle()->GetWebContents()->GetAllFrames()) {
48 if (frame->GetFrameTreeNodeId() == 48 if (frame->GetFrameTreeNodeId() ==
49 navigation_handle()->GetFrameTreeNodeId()) { 49 navigation_handle()->GetFrameTreeNodeId()) {
50 navigating_frame = frame; 50 navigating_frame = frame;
51 break; 51 break;
52 } 52 }
53 } 53 }
54 DCHECK(navigating_frame); 54 DCHECK(navigating_frame);
55 55
56 // Traverse the chain of parent frames, checking if they are the same origin 56 // Traverse the chain of parent frames, checking if they are the same origin
57 // as the URL of this navigation. 57 // as the URL of this navigation.
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 if (WebAccessibleResourcesInfo::IsResourceWebAccessible(extension, 90 if (WebAccessibleResourcesInfo::IsResourceWebAccessible(extension,
91 resource_path)) { 91 resource_path)) {
92 return content::NavigationThrottle::PROCEED; 92 return content::NavigationThrottle::PROCEED;
93 } 93 }
94 94
95 return content::NavigationThrottle::BLOCK_REQUEST; 95 return content::NavigationThrottle::BLOCK_REQUEST;
96 } 96 }
97 97
98 } // namespace extensions 98 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/event_router.cc ('k') | extensions/browser/guest_view/extension_options/extension_options_guest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698