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

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

Issue 16703018: Rewrite scoped_ptr<T>(NULL) to use the default ctor in chrome/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
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/user_script_slave.h" 5 #include "chrome/renderer/extensions/user_script_slave.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 119 }
120 } 120 }
121 } 121 }
122 } 122 }
123 123
124 void UserScriptSlave::RemoveIsolatedWorld(const std::string& extension_id) { 124 void UserScriptSlave::RemoveIsolatedWorld(const std::string& extension_id) {
125 isolated_world_ids_.erase(extension_id); 125 isolated_world_ids_.erase(extension_id);
126 } 126 }
127 127
128 UserScriptSlave::UserScriptSlave(const ExtensionSet* extensions) 128 UserScriptSlave::UserScriptSlave(const ExtensionSet* extensions)
129 : shared_memory_(NULL), 129 : script_deleter_(&scripts_), extensions_(extensions) {
130 script_deleter_(&scripts_),
131 extensions_(extensions) {
132 api_js_ = ResourceBundle::GetSharedInstance().GetRawDataResource( 130 api_js_ = ResourceBundle::GetSharedInstance().GetRawDataResource(
133 IDR_GREASEMONKEY_API_JS); 131 IDR_GREASEMONKEY_API_JS);
134 } 132 }
135 133
136 UserScriptSlave::~UserScriptSlave() {} 134 UserScriptSlave::~UserScriptSlave() {}
137 135
138 void UserScriptSlave::GetActiveExtensions( 136 void UserScriptSlave::GetActiveExtensions(
139 std::set<std::string>* extension_ids) { 137 std::set<std::string>* extension_ids) {
140 for (size_t i = 0; i < scripts_.size(); ++i) { 138 for (size_t i = 0; i < scripts_.size(); ++i) {
141 DCHECK(!scripts_[i]->extension_id().empty()); 139 DCHECK(!scripts_[i]->extension_id().empty());
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 } else if (location == UserScript::DOCUMENT_IDLE) { 377 } else if (location == UserScript::DOCUMENT_IDLE) {
380 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectIdle_ScriptCount", num_scripts); 378 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectIdle_ScriptCount", num_scripts);
381 if (num_scripts) 379 if (num_scripts)
382 UMA_HISTOGRAM_TIMES("Extensions.InjectIdle_Time", timer.Elapsed()); 380 UMA_HISTOGRAM_TIMES("Extensions.InjectIdle_Time", timer.Elapsed());
383 } else { 381 } else {
384 NOTREACHED(); 382 NOTREACHED();
385 } 383 }
386 } 384 }
387 385
388 } // namespace extensions 386 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698