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

Side by Side Diff: chrome/renderer/net_benchmarking_extension.cc

Issue 1103273009: Use v8::Local inplace of v8::Handle in src/chrome/* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
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 25 matching lines...) Expand all
36 "chrome.benchmarking.clearPredictorCache = function() {" 36 "chrome.benchmarking.clearPredictorCache = function() {"
37 " native function ClearPredictorCache();" 37 " native function ClearPredictorCache();"
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 v8::Handle<v8::FunctionTemplate> GetNativeFunctionTemplate( 46 v8::Local<v8::FunctionTemplate> GetNativeFunctionTemplate(
47 v8::Isolate* isolate, 47 v8::Isolate* isolate,
48 v8::Handle<v8::String> name) override { 48 v8::Local<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"))) {
59 return v8::FunctionTemplate::New(isolate, CloseConnections); 59 return v8::FunctionTemplate::New(isolate, CloseConnections);
60 } 60 }
61 61
62 return v8::Handle<v8::FunctionTemplate>(); 62 return v8::Local<v8::FunctionTemplate>();
63 } 63 }
64 64
65 static void ClearCache(const v8::FunctionCallbackInfo<v8::Value>& args) { 65 static void ClearCache(const v8::FunctionCallbackInfo<v8::Value>& args) {
66 int rv; 66 int rv;
67 content::RenderThread::Get()->Send(new ChromeViewHostMsg_ClearCache(&rv)); 67 content::RenderThread::Get()->Send(new ChromeViewHostMsg_ClearCache(&rv));
68 WebCache::clear(); 68 WebCache::clear();
69 } 69 }
70 70
71 static void ClearHostResolverCache( 71 static void ClearHostResolverCache(
72 const v8::FunctionCallbackInfo<v8::Value>& args) { 72 const v8::FunctionCallbackInfo<v8::Value>& args) {
(...skipping 12 matching lines...) Expand all
85 content::RenderThread::Get()->Send( 85 content::RenderThread::Get()->Send(
86 new ChromeViewHostMsg_CloseCurrentConnections()); 86 new ChromeViewHostMsg_CloseCurrentConnections());
87 } 87 }
88 }; 88 };
89 89
90 v8::Extension* NetBenchmarkingExtension::Get() { 90 v8::Extension* NetBenchmarkingExtension::Get() {
91 return new NetBenchmarkingWrapper(); 91 return new NetBenchmarkingWrapper();
92 } 92 }
93 93
94 } // namespace extensions_v8 94 } // namespace extensions_v8
OLDNEW
« no previous file with comments | « chrome/renderer/net/net_error_page_controller.cc ('k') | chrome/renderer/plugins/chrome_plugin_placeholder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698