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

Side by Side Diff: extensions/renderer/extension_injection_host.cc

Issue 1899083003: Convert //extensions/renderer from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/renderer/extension_injection_host.h" 5 #include "extensions/renderer/extension_injection_host.h"
6 6
7 #include "content/public/renderer/render_frame.h" 7 #include "content/public/renderer/render_frame.h"
8 #include "extensions/common/constants.h" 8 #include "extensions/common/constants.h"
9 #include "extensions/common/manifest_handlers/csp_info.h" 9 #include "extensions/common/manifest_handlers/csp_info.h"
10 #include "extensions/renderer/renderer_extension_registry.h" 10 #include "extensions/renderer/renderer_extension_registry.h"
11 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" 11 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h"
12 #include "third_party/WebKit/public/web/WebLocalFrame.h" 12 #include "third_party/WebKit/public/web/WebLocalFrame.h"
13 13
14 namespace extensions { 14 namespace extensions {
15 15
16 ExtensionInjectionHost::ExtensionInjectionHost( 16 ExtensionInjectionHost::ExtensionInjectionHost(
17 const Extension* extension) 17 const Extension* extension)
18 : InjectionHost(HostID(HostID::EXTENSIONS, extension->id())), 18 : InjectionHost(HostID(HostID::EXTENSIONS, extension->id())),
19 extension_(extension) { 19 extension_(extension) {
20 } 20 }
21 21
22 ExtensionInjectionHost::~ExtensionInjectionHost() { 22 ExtensionInjectionHost::~ExtensionInjectionHost() {
23 } 23 }
24 24
25 // static 25 // static
26 scoped_ptr<const InjectionHost> ExtensionInjectionHost::Create( 26 std::unique_ptr<const InjectionHost> ExtensionInjectionHost::Create(
27 const std::string& extension_id) { 27 const std::string& extension_id) {
28 const Extension* extension = 28 const Extension* extension =
29 RendererExtensionRegistry::Get()->GetByID(extension_id); 29 RendererExtensionRegistry::Get()->GetByID(extension_id);
30 if (!extension) 30 if (!extension)
31 return scoped_ptr<const ExtensionInjectionHost>(); 31 return std::unique_ptr<const ExtensionInjectionHost>();
32 return scoped_ptr<const ExtensionInjectionHost>( 32 return std::unique_ptr<const ExtensionInjectionHost>(
33 new ExtensionInjectionHost(extension)); 33 new ExtensionInjectionHost(extension));
34 } 34 }
35 35
36 std::string ExtensionInjectionHost::GetContentSecurityPolicy() const { 36 std::string ExtensionInjectionHost::GetContentSecurityPolicy() const {
37 return CSPInfo::GetContentSecurityPolicy(extension_); 37 return CSPInfo::GetContentSecurityPolicy(extension_);
38 } 38 }
39 39
40 const GURL& ExtensionInjectionHost::url() const { 40 const GURL& ExtensionInjectionHost::url() const {
41 return extension_->url(); 41 return extension_->url();
42 } 42 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 (tab_id == -1 || render_frame->GetWebFrame()->parent())) { 79 (tab_id == -1 || render_frame->GetWebFrame()->parent())) {
80 // Note: we don't consider ACCESS_WITHHELD for child frames or for frames 80 // Note: we don't consider ACCESS_WITHHELD for child frames or for frames
81 // outside of tabs because there is nowhere to surface a request. 81 // outside of tabs because there is nowhere to surface a request.
82 // TODO(devlin): We should ask for permission somehow. crbug.com/491402. 82 // TODO(devlin): We should ask for permission somehow. crbug.com/491402.
83 access = PermissionsData::ACCESS_DENIED; 83 access = PermissionsData::ACCESS_DENIED;
84 } 84 }
85 return access; 85 return access;
86 } 86 }
87 87
88 } // namespace extensions 88 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/extension_injection_host.h ('k') | extensions/renderer/extensions_render_frame_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698