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

Unified Diff: chrome/renderer/extensions/user_script_scheduler.cc

Issue 12390076: Attaching a DOM Activity Logger to all extension scripts (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/extensions/dom_activity_logger.cc ('k') | chrome/renderer/extensions/user_script_slave.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/user_script_scheduler.cc
===================================================================
--- chrome/renderer/extensions/user_script_scheduler.cc (revision 186214)
+++ chrome/renderer/extensions/user_script_scheduler.cc (working copy)
@@ -5,10 +5,13 @@
#include "chrome/renderer/extensions/user_script_scheduler.h"
#include "base/bind.h"
+#include "base/logging.h"
#include "base/message_loop.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
#include "chrome/common/extensions/extension_messages.h"
+#include "chrome/renderer/chrome_render_process_observer.h"
#include "chrome/renderer/extensions/dispatcher.h"
+#include "chrome/renderer/extensions/dom_activity_logger.h"
#include "chrome/renderer/extensions/extension_groups.h"
#include "chrome/renderer/extensions/extension_helper.h"
#include "chrome/renderer/extensions/user_script_slave.h"
@@ -201,17 +204,29 @@
scoped_ptr<content::V8ValueConverter> v8_converter(
content::V8ValueConverter::create());
v8::Handle<v8::Value> script_value;
+
if (params.in_main_world) {
+ DOMActivityLogger::AttachToWorld(
+ DOMActivityLogger::kMainWorldId,
+ extension->id(),
+ UserScriptSlave::GetDataSourceURLForFrame(child_frame),
+ child_frame->document().title());
script_value = child_frame->executeScriptAndReturnValue(source);
} else {
WebKit::WebVector<v8::Local<v8::Value> > results;
std::vector<WebScriptSource> sources;
sources.push_back(source);
+ int isolated_world_id =
+ dispatcher_->user_script_slave()->GetIsolatedWorldIdForExtension(
+ extension, child_frame);
+ DOMActivityLogger::AttachToWorld(
+ isolated_world_id,
+ extension->id(),
+ UserScriptSlave::GetDataSourceURLForFrame(child_frame),
+ child_frame->document().title());
child_frame->executeScriptInIsolatedWorld(
- dispatcher_->user_script_slave()->
- GetIsolatedWorldIdForExtension(extension, child_frame),
- &sources.front(), sources.size(), EXTENSION_GROUP_CONTENT_SCRIPTS,
- &results);
+ isolated_world_id, &sources.front(),
+ sources.size(), EXTENSION_GROUP_CONTENT_SCRIPTS, &results);
// We only expect one value back since we only pushed one source
if (results.size() == 1 && !results[0].IsEmpty())
script_value = results[0];
« no previous file with comments | « chrome/renderer/extensions/dom_activity_logger.cc ('k') | chrome/renderer/extensions/user_script_slave.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698