OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
11 #include "base/perftimer.h" | 11 #include "base/perftimer.h" |
12 #include "base/pickle.h" | 12 #include "base/pickle.h" |
13 #include "base/shared_memory.h" | 13 #include "base/shared_memory.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
15 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
16 #include "chrome/common/extensions/extension.h" | 16 #include "chrome/common/extensions/extension.h" |
17 #include "chrome/common/extensions/extension_set.h" | 17 #include "chrome/common/extensions/extension_set.h" |
18 #include "chrome/common/url_constants.h" | 18 #include "chrome/common/url_constants.h" |
19 #include "chrome/renderer/chrome_render_process_observer.h" | 19 #include "chrome/renderer/chrome_render_process_observer.h" |
20 #include "chrome/renderer/extensions/extension_dispatcher.h" | 20 #include "chrome/renderer/extensions/extension_dispatcher.h" |
21 #include "chrome/renderer/extensions/extension_groups.h" | 21 #include "chrome/renderer/extensions/extension_groups.h" |
22 #include "content/public/renderer/render_thread.h" | 22 #include "content/public/renderer/render_thread.h" |
23 #include "googleurl/src/gurl.h" | 23 #include "googleurl/src/gurl.h" |
24 #include "grit/renderer_resources.h" | 24 #include "grit/renderer_resources.h" |
25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" | 25 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" |
26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 26 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 27 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" | 29 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" |
30 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" | 30 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques
t.h" |
31 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" | 31 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 32 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
33 #include "ui/base/resource/resource_bundle.h" | 33 #include "ui/base/resource/resource_bundle.h" |
34 | 34 |
35 using WebKit::WebFrame; | 35 using WebKit::WebFrame; |
36 using WebKit::WebSecurityOrigin; | 36 using WebKit::WebSecurityOrigin; |
37 using WebKit::WebSecurityPolicy; | 37 using WebKit::WebSecurityPolicy; |
38 using WebKit::WebString; | 38 using WebKit::WebString; |
39 using WebKit::WebVector; | 39 using WebKit::WebVector; |
40 using WebKit::WebView; | 40 using WebKit::WebView; |
41 using content::RenderThread; | 41 using content::RenderThread; |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 if (num_scripts) | 335 if (num_scripts) |
336 UMA_HISTOGRAM_TIMES("Extensions.InjectEnd_Time", timer.Elapsed()); | 336 UMA_HISTOGRAM_TIMES("Extensions.InjectEnd_Time", timer.Elapsed()); |
337 } else if (location == UserScript::DOCUMENT_IDLE) { | 337 } else if (location == UserScript::DOCUMENT_IDLE) { |
338 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectIdle_ScriptCount", num_scripts); | 338 UMA_HISTOGRAM_COUNTS_100("Extensions.InjectIdle_ScriptCount", num_scripts); |
339 if (num_scripts) | 339 if (num_scripts) |
340 UMA_HISTOGRAM_TIMES("Extensions.InjectIdle_Time", timer.Elapsed()); | 340 UMA_HISTOGRAM_TIMES("Extensions.InjectIdle_Time", timer.Elapsed()); |
341 } else { | 341 } else { |
342 NOTREACHED(); | 342 NOTREACHED(); |
343 } | 343 } |
344 } | 344 } |
OLD | NEW |