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

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

Issue 2252373002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/script_injection_manager.h" 5 #include "extensions/renderer/script_injection_manager.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 264
265 ScriptInjectionManager::~ScriptInjectionManager() { 265 ScriptInjectionManager::~ScriptInjectionManager() {
266 for (const auto& injection : pending_injections_) 266 for (const auto& injection : pending_injections_)
267 injection->invalidate_render_frame(); 267 injection->invalidate_render_frame();
268 for (const auto& injection : running_injections_) 268 for (const auto& injection : running_injections_)
269 injection->invalidate_render_frame(); 269 injection->invalidate_render_frame();
270 } 270 }
271 271
272 void ScriptInjectionManager::OnRenderFrameCreated( 272 void ScriptInjectionManager::OnRenderFrameCreated(
273 content::RenderFrame* render_frame) { 273 content::RenderFrame* render_frame) {
274 rfo_helpers_.push_back(base::WrapUnique(new RFOHelper(render_frame, this))); 274 rfo_helpers_.push_back(base::MakeUnique<RFOHelper>(render_frame, this));
275 } 275 }
276 276
277 void ScriptInjectionManager::OnExtensionUnloaded( 277 void ScriptInjectionManager::OnExtensionUnloaded(
278 const std::string& extension_id) { 278 const std::string& extension_id) {
279 for (auto iter = pending_injections_.begin(); 279 for (auto iter = pending_injections_.begin();
280 iter != pending_injections_.end();) { 280 iter != pending_injections_.end();) {
281 if ((*iter)->host_id().id() == extension_id) { 281 if ((*iter)->host_id().id() == extension_id) {
282 (*iter)->OnHostRemoved(); 282 (*iter)->OnHostRemoved();
283 iter = pending_injections_.erase(iter); 283 iter = pending_injections_.erase(iter);
284 } else { 284 } else {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 ScriptsRunInfo scripts_run_info(injection->render_frame(), 502 ScriptsRunInfo scripts_run_info(injection->render_frame(),
503 UserScript::RUN_DEFERRED); 503 UserScript::RUN_DEFERRED);
504 ScriptInjection::InjectionResult res = injection->OnPermissionGranted( 504 ScriptInjection::InjectionResult res = injection->OnPermissionGranted(
505 &scripts_run_info); 505 &scripts_run_info);
506 if (res == ScriptInjection::INJECTION_BLOCKED) 506 if (res == ScriptInjection::INJECTION_BLOCKED)
507 running_injections_.push_back(std::move(injection)); 507 running_injections_.push_back(std::move(injection));
508 scripts_run_info.LogRun(activity_logging_enabled_); 508 scripts_run_info.LogRun(activity_logging_enabled_);
509 } 509 }
510 510
511 } // namespace extensions 511 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/i18n_custom_bindings.cc ('k') | extensions/shell/browser/shell_desktop_controller_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698