OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/net_benchmarking_extension.h" | 5 #include "chrome/renderer/net_benchmarking_extension.h" |
6 | 6 |
7 #include "chrome/common/benchmarking_messages.h" | 7 #include "chrome/common/benchmarking_messages.h" |
8 #include "content/public/renderer/render_thread.h" | 8 #include "content/public/renderer/render_thread.h" |
9 #include "third_party/WebKit/public/web/WebCache.h" | 9 #include "third_party/WebKit/public/web/WebCache.h" |
10 #include "v8/include/v8.h" | 10 #include "v8/include/v8.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 " ClearPredictorCache();" | 38 " ClearPredictorCache();" |
39 "};" | 39 "};" |
40 "chrome.benchmarking.closeConnections = function() {" | 40 "chrome.benchmarking.closeConnections = function() {" |
41 " native function CloseConnections();" | 41 " native function CloseConnections();" |
42 " CloseConnections();" | 42 " CloseConnections();" |
43 "};" | 43 "};" |
44 ) {} | 44 ) {} |
45 | 45 |
46 virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate( | 46 virtual v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate( |
47 v8::Isolate* isolate, | 47 v8::Isolate* isolate, |
48 v8::Handle<v8::String> name) OVERRIDE { | 48 v8::Handle<v8::String> name) override { |
49 if (name->Equals(v8::String::NewFromUtf8(isolate, "ClearCache"))) { | 49 if (name->Equals(v8::String::NewFromUtf8(isolate, "ClearCache"))) { |
50 return v8::FunctionTemplate::New(isolate, ClearCache); | 50 return v8::FunctionTemplate::New(isolate, ClearCache); |
51 } else if (name->Equals(v8::String::NewFromUtf8( | 51 } else if (name->Equals(v8::String::NewFromUtf8( |
52 isolate, "ClearHostResolverCache"))) { | 52 isolate, "ClearHostResolverCache"))) { |
53 return v8::FunctionTemplate::New(isolate, ClearHostResolverCache); | 53 return v8::FunctionTemplate::New(isolate, ClearHostResolverCache); |
54 } else if (name->Equals( | 54 } else if (name->Equals( |
55 v8::String::NewFromUtf8(isolate, "ClearPredictorCache"))) { | 55 v8::String::NewFromUtf8(isolate, "ClearPredictorCache"))) { |
56 return v8::FunctionTemplate::New(isolate, ClearPredictorCache); | 56 return v8::FunctionTemplate::New(isolate, ClearPredictorCache); |
57 } else if (name->Equals( | 57 } else if (name->Equals( |
58 v8::String::NewFromUtf8(isolate, "CloseConnections"))) { | 58 v8::String::NewFromUtf8(isolate, "CloseConnections"))) { |
(...skipping 28 matching lines...) Expand all Loading... |
87 content::RenderThread::Get()->Send( | 87 content::RenderThread::Get()->Send( |
88 new ChromeViewHostMsg_CloseCurrentConnections()); | 88 new ChromeViewHostMsg_CloseCurrentConnections()); |
89 } | 89 } |
90 }; | 90 }; |
91 | 91 |
92 v8::Extension* NetBenchmarkingExtension::Get() { | 92 v8::Extension* NetBenchmarkingExtension::Get() { |
93 return new NetBenchmarkingWrapper(); | 93 return new NetBenchmarkingWrapper(); |
94 } | 94 } |
95 | 95 |
96 } // namespace extensions_v8 | 96 } // namespace extensions_v8 |
OLD | NEW |