| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |