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

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

Issue 271553006: Fix activity logging for extension background pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/dom_activity_logger.h" 5 #include "extensions/renderer/dom_activity_logger.h"
6 6
7 #include "content/public/renderer/render_thread.h" 7 #include "content/public/renderer/render_thread.h"
8 #include "content/public/renderer/v8_value_converter.h" 8 #include "content/public/renderer/v8_value_converter.h"
9 #include "extensions/common/ad_injection_constants.h" 9 #include "extensions/common/ad_injection_constants.h"
10 #include "extensions/common/dom_action_types.h" 10 #include "extensions/common/dom_action_types.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 : extension_id_(extension_id) { 46 : extension_id_(extension_id) {
47 } 47 }
48 48
49 DOMActivityLogger::~DOMActivityLogger() {} 49 DOMActivityLogger::~DOMActivityLogger() {}
50 50
51 void DOMActivityLogger::AttachToWorld(int world_id, 51 void DOMActivityLogger::AttachToWorld(int world_id,
52 const std::string& extension_id) { 52 const std::string& extension_id) {
53 #if defined(ENABLE_EXTENSIONS) 53 #if defined(ENABLE_EXTENSIONS)
54 // If there is no logger registered for world_id, construct a new logger 54 // If there is no logger registered for world_id, construct a new logger
55 // and register it with world_id. 55 // and register it with world_id.
56 if (!blink::hasDOMActivityLogger(world_id)) { 56 if (!blink::hasDOMActivityLogger(world_id,
57 WebString::fromUTF8(extension_id))) {
57 DOMActivityLogger* logger = new DOMActivityLogger(extension_id); 58 DOMActivityLogger* logger = new DOMActivityLogger(extension_id);
58 blink::setDOMActivityLogger(world_id, logger); 59 blink::setDOMActivityLogger(world_id,
60 WebString::fromUTF8(extension_id),
61 logger);
59 } 62 }
60 #endif 63 #endif
61 } 64 }
62 65
63 void DOMActivityLogger::logGetter(const WebString& api_name, 66 void DOMActivityLogger::logGetter(const WebString& api_name,
64 const WebURL& url, 67 const WebURL& url,
65 const WebString& title) { 68 const WebString& title) {
66 SendDomActionMessage(api_name.utf8(), 69 SendDomActionMessage(api_name.utf8(),
67 url, 70 url,
68 title, 71 title,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 params.api_call = api_call; 116 params.api_call = api_call;
114 params.url = url; 117 params.url = url;
115 params.url_title = url_title; 118 params.url_title = url_title;
116 params.call_type = call_type; 119 params.call_type = call_type;
117 params.arguments.Swap(args.get()); 120 params.arguments.Swap(args.get());
118 content::RenderThread::Get()->Send( 121 content::RenderThread::Get()->Send(
119 new ExtensionHostMsg_AddDOMActionToActivityLog(extension_id_, params)); 122 new ExtensionHostMsg_AddDOMActionToActivityLog(extension_id_, params));
120 } 123 }
121 124
122 } // namespace extensions 125 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698