diff options
author | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-09 21:07:41 +0000 |
---|---|---|
committer | tfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-09 21:07:41 +0000 |
commit | 2ced3a350c7c160a20cb1f2aea1d6ae9c49f5da0 (patch) | |
tree | 0e1d7f9d6d9405203cb8e20aa782a9993bb4dd01 /webkit/extensions | |
parent | 9816a5d291165560436a4882c1ee222cc326f209 (diff) | |
download | chromium_src-2ced3a350c7c160a20cb1f2aea1d6ae9c49f5da0.zip chromium_src-2ced3a350c7c160a20cb1f2aea1d6ae9c49f5da0.tar.gz chromium_src-2ced3a350c7c160a20cb1f2aea1d6ae9c49f5da0.tar.bz2 |
Forward declare v8::Extension in webkit/extensions/v8/*.
TBR=asargent@chromium.org
R=mihaip@chromium.org
Review URL: http://codereview.chromium.org/7860006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100490 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/extensions')
-rw-r--r-- | webkit/extensions/v8/benchmarking_extension.cc | 9 | ||||
-rw-r--r-- | webkit/extensions/v8/benchmarking_extension.h | 14 | ||||
-rw-r--r-- | webkit/extensions/v8/playback_extension.cc | 8 | ||||
-rw-r--r-- | webkit/extensions/v8/playback_extension.h | 7 | ||||
-rw-r--r-- | webkit/extensions/v8/profiler_extension.cc | 30 | ||||
-rw-r--r-- | webkit/extensions/v8/profiler_extension.h | 14 |
6 files changed, 43 insertions, 39 deletions
diff --git a/webkit/extensions/v8/benchmarking_extension.cc b/webkit/extensions/v8/benchmarking_extension.cc index e622ba7..f3f4c72 100644 --- a/webkit/extensions/v8/benchmarking_extension.cc +++ b/webkit/extensions/v8/benchmarking_extension.cc @@ -1,21 +1,20 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "webkit/extensions/v8/benchmarking_extension.h" -#include "base/command_line.h" #include "base/metrics/stats_table.h" #include "base/time.h" -#include "net/http/http_network_layer.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h" +#include "v8/include/v8.h" #include "webkit/glue/webkit_glue.h" using WebKit::WebCache; -namespace extensions_v8 { +const char kBenchmarkingExtensionName[] = "v8/Benchmarking"; -const char* kBenchmarkingExtensionName = "v8/Benchmarking"; +namespace extensions_v8 { class BenchmarkingWrapper : public v8::Extension { public: diff --git a/webkit/extensions/v8/benchmarking_extension.h b/webkit/extensions/v8/benchmarking_extension.h index 0ce9850..3aa5cee 100644 --- a/webkit/extensions/v8/benchmarking_extension.h +++ b/webkit/extensions/v8/benchmarking_extension.h @@ -1,18 +1,20 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Profiler is an extension to allow javascript access to the API for -// an external profiler program (such as Quantify). The "External" part of the -// name is to distinguish it from the built-in V8 Profiler. - #ifndef WEBKIT_EXTENSIONS_V8_BENCHMARKING_EXTENSION_H_ #define WEBKIT_EXTENSIONS_V8_BENCHMARKING_EXTENSION_H_ +#pragma once -#include "v8/include/v8.h" +namespace v8 { +class Extension; +} namespace extensions_v8 { +// Profiler is an extension to allow javascript access to the API for +// an external profiler program (such as Quantify). The "External" part of the +// name is to distinguish it from the built-in V8 Profiler. class BenchmarkingExtension { public: static v8::Extension* Get(); diff --git a/webkit/extensions/v8/playback_extension.cc b/webkit/extensions/v8/playback_extension.cc index 8751d36..c106c84 100644 --- a/webkit/extensions/v8/playback_extension.cc +++ b/webkit/extensions/v8/playback_extension.cc @@ -1,12 +1,14 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "webkit/extensions/v8/playback_extension.h" -namespace extensions_v8 { +#include "v8/include/v8.h" + +const char kPlaybackExtensionName[] = "v8/PlaybackMode"; -const char* kPlaybackExtensionName = "v8/PlaybackMode"; +namespace extensions_v8 { v8::Extension* PlaybackExtension::Get() { v8::Extension* extension = new v8::Extension( diff --git a/webkit/extensions/v8/playback_extension.h b/webkit/extensions/v8/playback_extension.h index 157fa17..3dc2be3 100644 --- a/webkit/extensions/v8/playback_extension.h +++ b/webkit/extensions/v8/playback_extension.h @@ -1,11 +1,14 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef WEBKIT_EXTENSIONS_V8_PLAYBACK_EXTENSION_H_ #define WEBKIT_EXTENSIONS_V8_PLAYBACK_EXTENSION_H_ +#pragma once -#include "v8/include/v8.h" +namespace v8 { +class Extension; +} namespace extensions_v8 { diff --git a/webkit/extensions/v8/profiler_extension.cc b/webkit/extensions/v8/profiler_extension.cc index 96bd542..18ff280 100644 --- a/webkit/extensions/v8/profiler_extension.cc +++ b/webkit/extensions/v8/profiler_extension.cc @@ -5,15 +5,16 @@ #include "webkit/extensions/v8/profiler_extension.h" #include "build/build_config.h" +#include "v8/include/v8.h" #if defined(USE_TCMALLOC) && defined(OS_POSIX) && !defined(OS_MACOSX) #include "third_party/tcmalloc/chromium/src/google/profiler.h" #endif -namespace extensions_v8 { - const char kProfilerExtensionName[] = "v8/Profiler"; +namespace extensions_v8 { + class ProfilerWrapper : public v8::Extension { public: ProfilerWrapper() : @@ -46,50 +47,45 @@ class ProfilerWrapper : public v8::Extension { virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction( v8::Handle<v8::String> name) { - if (name->Equals(v8::String::New("ProfilerStart"))) { + if (name->Equals(v8::String::New("ProfilerStart"))) return v8::FunctionTemplate::New(ProfilerStart); - } else if (name->Equals(v8::String::New("ProfilerStop"))) { + else if (name->Equals(v8::String::New("ProfilerStop"))) return v8::FunctionTemplate::New(ProfilerStop); - } else if (name->Equals(v8::String::New("ProfilerClearData"))) { + else if (name->Equals(v8::String::New("ProfilerClearData"))) return v8::FunctionTemplate::New(ProfilerClearData); - } else if (name->Equals(v8::String::New("ProfilerFlush"))) { + else if (name->Equals(v8::String::New("ProfilerFlush"))) return v8::FunctionTemplate::New(ProfilerFlush); - } else if (name->Equals(v8::String::New("ProfilerSetThreadName"))) { + else if (name->Equals(v8::String::New("ProfilerSetThreadName"))) return v8::FunctionTemplate::New(ProfilerSetThreadName); - } + return v8::Handle<v8::FunctionTemplate>(); } - static v8::Handle<v8::Value> ProfilerStart( - const v8::Arguments& args) { + static v8::Handle<v8::Value> ProfilerStart(const v8::Arguments& args) { #if defined(USE_TCMALLOC) && defined(OS_POSIX) && !defined(OS_MACOSX) ::ProfilerStart("chrome-profile"); #endif return v8::Undefined(); } - static v8::Handle<v8::Value> ProfilerStop( - const v8::Arguments& args) { + static v8::Handle<v8::Value> ProfilerStop(const v8::Arguments& args) { #if defined(USE_TCMALLOC) && defined(OS_POSIX) && !defined(OS_MACOSX) ::ProfilerStop(); #endif return v8::Undefined(); } - static v8::Handle<v8::Value> ProfilerClearData( - const v8::Arguments& args) { + static v8::Handle<v8::Value> ProfilerClearData(const v8::Arguments& args) { return v8::Undefined(); } - static v8::Handle<v8::Value> ProfilerFlush( - const v8::Arguments& args) { + static v8::Handle<v8::Value> ProfilerFlush(const v8::Arguments& args) { #if defined(USE_TCMALLOC) && defined(OS_POSIX) && !defined(OS_MACOSX) ::ProfilerFlush(); #endif return v8::Undefined(); } - static v8::Handle<v8::Value> ProfilerSetThreadName( const v8::Arguments& args) { if (args.Length() >= 1 && args[0]->IsString()) { diff --git a/webkit/extensions/v8/profiler_extension.h b/webkit/extensions/v8/profiler_extension.h index d56d66a..7032464 100644 --- a/webkit/extensions/v8/profiler_extension.h +++ b/webkit/extensions/v8/profiler_extension.h @@ -1,18 +1,20 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Profiler is an extension to allow javascript access to the API for -// an external profiler program (such as Quantify). The "External" part of the -// name is to distinguish it from the built-in V8 Profiler. - #ifndef WEBKIT_EXTENSIONS_V8_PROFILER_EXTENSION_H_ #define WEBKIT_EXTENSIONS_V8_PROFILER_EXTENSION_H_ +#pragma once -#include "v8/include/v8.h" +namespace v8 { +class Extension; +} namespace extensions_v8 { +// Profiler is an extension to allow javascript access to the API for +// an external profiler program (such as Quantify). The "External" part of the +// name is to distinguish it from the built-in V8 Profiler. class ProfilerExtension { public: static v8::Extension* Get(); |