summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/app/chrome_main.cc5
-rw-r--r--chrome/browser/chrome_benchmarking_message_filter.cc237
-rw-r--r--chrome/browser/chrome_benchmarking_message_filter.h56
-rw-r--r--chrome/browser/chrome_content_browser_client.cc10
-rw-r--r--chrome/browser/renderer_host/chrome_render_message_filter.cc11
-rw-r--r--chrome/browser/renderer_host/chrome_render_message_filter.h1
-rw-r--r--chrome/chrome_browser.gypi2
-rw-r--r--chrome/chrome_renderer.gypi2
-rw-r--r--chrome/common/benchmarking_messages.h50
-rw-r--r--chrome/common/chrome_switches.cc3
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/common/common_message_generator.h1
-rw-r--r--chrome/renderer/benchmarking_extension.cc (renamed from webkit/extensions/v8/benchmarking_extension.cc)22
-rw-r--r--chrome/renderer/benchmarking_extension.h (renamed from webkit/extensions/v8/benchmarking_extension.h)7
-rw-r--r--chrome/renderer/chrome_content_renderer_client.cc5
-rw-r--r--content/app/content_main.cc3
-rw-r--r--content/browser/browser_main.cc2
-rw-r--r--content/browser/renderer_host/browser_render_process_host.cc1
-rw-r--r--content/browser/renderer_host/render_message_filter.cc162
-rw-r--r--content/browser/renderer_host/render_message_filter.h5
-rw-r--r--content/common/content_switches.cc3
-rw-r--r--content/common/content_switches.h1
-rw-r--r--content/common/view_messages.h35
-rw-r--r--content/renderer/render_thread.cc31
-rw-r--r--content/renderer/render_thread.h20
-rw-r--r--content/renderer/renderer_glue.cc24
-rw-r--r--ipc/ipc_message_utils.h1
-rw-r--r--webkit/glue/webkit_glue.gypi2
-rw-r--r--webkit/glue/webkit_glue.h21
-rw-r--r--webkit/support/webkit_support_glue.cc15
-rw-r--r--webkit/tools/test_shell/test_shell.cc24
31 files changed, 394 insertions, 369 deletions
diff --git a/chrome/app/chrome_main.cc b/chrome/app/chrome_main.cc
index be83bbe..c5376e4 100644
--- a/chrome/app/chrome_main.cc
+++ b/chrome/app/chrome_main.cc
@@ -5,6 +5,7 @@
#include "base/command_line.h"
#include "base/lazy_instance.h"
#include "base/message_loop.h"
+#include "base/metrics/field_trial.h"
#include "base/metrics/stats_counters.h"
#include "base/path_service.h"
#include "base/process_util.h"
@@ -419,6 +420,10 @@ class ChromeMainDelegate : public content::ContentMainDelegate {
}
#endif
+ if (process_type == "" &&
+ command_line.HasSwitch(switches::kEnableBenchmarking)) {
+ base::FieldTrial::EnableBenchmarking();
+ }
return false;
}
diff --git a/chrome/browser/chrome_benchmarking_message_filter.cc b/chrome/browser/chrome_benchmarking_message_filter.cc
new file mode 100644
index 0000000..c1fb93e
--- /dev/null
+++ b/chrome/browser/chrome_benchmarking_message_filter.cc
@@ -0,0 +1,237 @@
+// 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 "chrome/browser/chrome_benchmarking_message_filter.h"
+
+#include "base/command_line.h"
+#include "chrome/browser/net/chrome_url_request_context.h"
+#include "chrome/browser/net/predictor.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/benchmarking_messages.h"
+#include "chrome/common/chrome_switches.h"
+#include "net/base/host_resolver_impl.h"
+#include "net/base/net_errors.h"
+#include "net/disk_cache/disk_cache.h"
+#include "net/http/http_cache.h"
+#include "net/http/http_network_layer.h"
+
+namespace {
+
+class ClearCacheCompletion : public net::CompletionCallback {
+ public:
+ ClearCacheCompletion(ChromeBenchmarkingMessageFilter* filter,
+ IPC::Message* reply_msg)
+ : filter_(filter),
+ reply_msg_(reply_msg) {
+ }
+
+ virtual void RunWithParams(const Tuple1<int>& params) {
+ ChromeViewHostMsg_ClearCache::WriteReplyParams(reply_msg_, params.a);
+ filter_->Send(reply_msg_);
+ delete this;
+ }
+
+ private:
+ scoped_refptr<ChromeBenchmarkingMessageFilter> filter_;
+ IPC::Message* reply_msg_;
+};
+
+// Class to assist with clearing out the cache when we want to preserve
+// the sslhostinfo entries. It's not very efficient, but its just for debug.
+class DoomEntriesHelper {
+ public:
+ explicit DoomEntriesHelper(disk_cache::Backend* backend)
+ : backend_(backend),
+ entry_(NULL),
+ iter_(NULL),
+ ALLOW_THIS_IN_INITIALIZER_LIST(callback_(this,
+ &DoomEntriesHelper::CacheCallback)),
+ user_callback_(NULL) {
+ }
+
+ void ClearCache(ClearCacheCompletion* callback) {
+ user_callback_ = callback;
+ return CacheCallback(net::OK); // Start clearing the cache.
+ }
+
+ private:
+ void CacheCallback(int result) {
+ do {
+ if (result != net::OK) {
+ user_callback_->RunWithParams(Tuple1<int>(result));
+ delete this;
+ return;
+ }
+
+ if (entry_) {
+ // Doom all entries except those with snapstart information.
+ std::string key = entry_->GetKey();
+ if (key.find("sslhostinfo:") != 0) {
+ entry_->Doom();
+ backend_->EndEnumeration(&iter_);
+ iter_ = NULL; // We invalidated our iterator - start from the top!
+ }
+ entry_->Close();
+ entry_ = NULL;
+ }
+ result = backend_->OpenNextEntry(&iter_, &entry_, &callback_);
+ } while (result != net::ERR_IO_PENDING);
+ }
+
+ disk_cache::Backend* backend_;
+ disk_cache::Entry* entry_;
+ void* iter_;
+ net::CompletionCallbackImpl<DoomEntriesHelper> callback_;
+ ClearCacheCompletion* user_callback_;
+};
+
+} // namespace
+
+ChromeBenchmarkingMessageFilter::ChromeBenchmarkingMessageFilter(
+ int render_process_id,
+ Profile* profile,
+ net::URLRequestContextGetter* request_context)
+ : render_process_id_(render_process_id),
+ profile_(profile),
+ request_context_(request_context) {
+}
+
+ChromeBenchmarkingMessageFilter::~ChromeBenchmarkingMessageFilter() {
+}
+
+bool ChromeBenchmarkingMessageFilter::OnMessageReceived(
+ const IPC::Message& message, bool* message_was_ok) {
+ bool handled = true;
+ IPC_BEGIN_MESSAGE_MAP_EX(ChromeBenchmarkingMessageFilter, message,
+ *message_was_ok)
+ IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CloseCurrentConnections,
+ OnCloseCurrentConnections)
+ IPC_MESSAGE_HANDLER_DELAY_REPLY(ChromeViewHostMsg_ClearCache, OnClearCache)
+ IPC_MESSAGE_HANDLER(ChromeViewHostMsg_ClearHostResolverCache,
+ OnClearHostResolverCache)
+ IPC_MESSAGE_HANDLER(ChromeViewHostMsg_EnableSpdy, OnEnableSpdy)
+ IPC_MESSAGE_HANDLER(ChromeViewHostMsg_ClearPredictorCache,
+ OnClearPredictorCache)
+ IPC_MESSAGE_UNHANDLED(handled = false)
+ IPC_END_MESSAGE_MAP_EX()
+ return handled;
+}
+
+void ChromeBenchmarkingMessageFilter::OnClearCache(bool preserve_ssl_host_info,
+ IPC::Message* reply_msg) {
+ // This function is disabled unless the user has enabled
+ // benchmarking extensions.
+ if (!CheckBenchmarkingEnabled()) {
+ NOTREACHED() << "Received unexpected benchmarking IPC";
+ return;
+ }
+ int rv = -1;
+
+ disk_cache::Backend* backend = request_context_->GetURLRequestContext()->
+ http_transaction_factory()->GetCache()->GetCurrentBackend();
+ if (backend) {
+ ClearCacheCompletion* callback =
+ new ClearCacheCompletion(this, reply_msg);
+ if (preserve_ssl_host_info) {
+ DoomEntriesHelper* helper = new DoomEntriesHelper(backend);
+ helper->ClearCache(callback); // Will self clean.
+ return;
+ } else {
+ rv = backend->DoomAllEntries(callback);
+ if (rv == net::ERR_IO_PENDING) {
+ // The callback will send the reply.
+ return;
+ }
+ // Completed synchronously, no need for the callback.
+ delete callback;
+ }
+ }
+ ChromeViewHostMsg_ClearCache::WriteReplyParams(reply_msg, rv);
+ Send(reply_msg);
+}
+
+void ChromeBenchmarkingMessageFilter::OnClearHostResolverCache(int* result) {
+ // This function is disabled unless the user has enabled
+ // benchmarking extensions.
+ if (!CheckBenchmarkingEnabled()) {
+ NOTREACHED() << "Received unexpected benchmarking IPC";
+ return;
+ }
+ *result = -1;
+ net::HostResolverImpl* host_resolver_impl =
+ request_context_->GetURLRequestContext()->
+ host_resolver()->GetAsHostResolverImpl();
+ if (host_resolver_impl) {
+ net::HostCache* cache = host_resolver_impl->cache();
+ DCHECK(cache);
+ cache->clear();
+ *result = 0;
+ }
+}
+
+// TODO(lzheng): This only enables spdy over ssl. Enable spdy for http
+// when needed.
+void ChromeBenchmarkingMessageFilter::OnEnableSpdy(bool enable) {
+ // This function is disabled unless the user has enabled
+ // benchmarking extensions.
+ if (!CheckBenchmarkingEnabled()) {
+ NOTREACHED() << "Received unexpected benchmarking IPC";
+ return;
+ }
+ if (enable) {
+ net::HttpNetworkLayer::EnableSpdy("npn,force-alt-protocols");
+ } else {
+ net::HttpNetworkLayer::EnableSpdy("npn-http");
+ }
+}
+
+void ChromeBenchmarkingMessageFilter::OnCloseCurrentConnections() {
+ // This function is disabled unless the user has enabled
+ // benchmarking extensions.
+ if (!CheckBenchmarkingEnabled()) {
+ NOTREACHED() << "Received unexpected benchmarking IPC";
+ return;
+ }
+ request_context_->GetURLRequestContext()->
+ http_transaction_factory()->GetCache()->CloseAllConnections();
+}
+
+void ChromeBenchmarkingMessageFilter::OnSetCacheMode(bool enabled) {
+ // This function is disabled unless the user has enabled
+ // benchmarking extensions.
+ if (!CheckBenchmarkingEnabled()) {
+ NOTREACHED() << "Received unexpected benchmarking IPC";
+ return;
+ }
+ net::HttpCache::Mode mode = enabled ?
+ net::HttpCache::NORMAL : net::HttpCache::DISABLE;
+ net::HttpCache* http_cache = request_context_->GetURLRequestContext()->
+ http_transaction_factory()->GetCache();
+ http_cache->set_mode(mode);
+}
+
+void ChromeBenchmarkingMessageFilter::OnClearPredictorCache(int* result) {
+ // This function is disabled unless the user has enabled
+ // benchmarking extensions.
+ if (!CheckBenchmarkingEnabled()) {
+ NOTREACHED() << "Received unexpected benchmarking IPC";
+ return;
+ }
+ chrome_browser_net::Predictor* predictor = profile_->GetNetworkPredictor();
+ if (predictor)
+ predictor->DiscardAllResults();
+ *result = 0;
+}
+
+bool ChromeBenchmarkingMessageFilter::CheckBenchmarkingEnabled() const {
+ static bool checked = false;
+ static bool result = false;
+ if (!checked) {
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ result = command_line.HasSwitch(switches::kEnableBenchmarking);
+ checked = true;
+ }
+ return result;
+}
+
diff --git a/chrome/browser/chrome_benchmarking_message_filter.h b/chrome/browser/chrome_benchmarking_message_filter.h
new file mode 100644
index 0000000..e8eee90
--- /dev/null
+++ b/chrome/browser/chrome_benchmarking_message_filter.h
@@ -0,0 +1,56 @@
+// 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 CHROME_BROWSER_CHROME_BENCHMARKING_MESSAGE_FILTER_H_
+#define CHROME_BROWSER_CHROME_BENCHMARKING_MESSAGE_FILTER_H_
+#pragma once
+
+#include "content/browser/browser_message_filter.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h"
+
+namespace net {
+class URLRequestContextGetter;
+}
+
+class Profile;
+
+// This class filters out incoming Chrome-specific benchmarking IPC messages
+// for the renderer process on the IPC thread.
+class ChromeBenchmarkingMessageFilter : public BrowserMessageFilter {
+ public:
+ ChromeBenchmarkingMessageFilter(
+ int render_process_id,
+ Profile* profile,
+ net::URLRequestContextGetter* request_context);
+
+ // BrowserMessageFilter methods:
+ virtual bool OnMessageReceived(const IPC::Message& message,
+ bool* message_was_ok);
+
+ private:
+ virtual ~ChromeBenchmarkingMessageFilter();
+
+ // Message handlers.
+ void OnCloseCurrentConnections();
+ void OnClearCache(bool preserve_ssl_host_info, IPC::Message* reply_msg);
+ void OnClearHostResolverCache(int* result);
+ void OnEnableSpdy(bool enable);
+ void OnSetCacheMode(bool enabled);
+ void OnClearPredictorCache(int* result);
+
+ // Returns true if benchmarking is enabled for chrome.
+ bool CheckBenchmarkingEnabled() const;
+
+ int render_process_id_;
+
+ // The Profile associated with our renderer process. This should only be
+ // accessed on the UI thread!
+ Profile* profile_;
+ scoped_refptr<net::URLRequestContextGetter> request_context_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeBenchmarkingMessageFilter);
+};
+
+#endif // CHROME_BROWSER_CHROME_BENCHMARKING_MESSAGE_FILTER_H_
+
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index bfe0d4e..958bec5 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browsing_data_remover.h"
#include "chrome/browser/character_encoding.h"
+#include "chrome/browser/chrome_benchmarking_message_filter.h"
#include "chrome/browser/chrome_plugin_message_filter.h"
#include "chrome/browser/chrome_quota_permission_context.h"
#include "chrome/browser/chrome_worker_message_filter.h"
@@ -172,6 +173,8 @@ void ChromeContentBrowserClient::BrowserRenderProcessHostCreated(
host->channel()->AddFilter(
new SearchProviderInstallStateMessageFilter(id, profile));
host->channel()->AddFilter(new SpellCheckMessageFilter(id));
+ host->channel()->AddFilter(new ChromeBenchmarkingMessageFilter(
+ id, profile, profile->GetRequestContextForRenderProcess(id)));
host->Send(new ChromeViewMsg_SetIsIncognitoProcess(
profile->IsOffTheRecord()));
@@ -335,6 +338,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
switches::kProfilingFile,
switches::kProfilingFlush,
switches::kSilentDumpOnDCHECK,
+ switches::kEnableBenchmarking,
};
command_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
@@ -368,6 +372,12 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
command_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
arraysize(kSwitchNames));
}
+
+ // The command line switch kEnableBenchmarking needs to be specified along
+ // with the kEnableStatsTable switch to ensure that the stats table global
+ // is initialized correctly.
+ if (command_line->HasSwitch(switches::kEnableBenchmarking))
+ DCHECK(command_line->HasSwitch(switches::kEnableStatsTable));
}
std::string ChromeContentBrowserClient::GetApplicationLocale() {
diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.cc b/chrome/browser/renderer_host/chrome_render_message_filter.cc
index 26e84bf..0b15023 100644
--- a/chrome/browser/renderer_host/chrome_render_message_filter.cc
+++ b/chrome/browser/renderer_host/chrome_render_message_filter.cc
@@ -29,7 +29,6 @@
#include "content/browser/renderer_host/render_process_host.h"
#include "content/browser/renderer_host/resource_dispatcher_host.h"
#include "content/common/url_constants.h"
-#include "content/common/view_messages.h"
#include "googleurl/src/gurl.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
@@ -139,7 +138,6 @@ bool ChromeRenderMessageFilter::OnMessageReceived(const IPC::Message& message,
OnCanTriggerClipboardRead)
IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CanTriggerClipboardWrite,
OnCanTriggerClipboardWrite)
- IPC_MESSAGE_HANDLER(ViewHostMsg_ClearPredictorCache, OnClearPredictorCache)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -512,15 +510,6 @@ void ChromeRenderMessageFilter::OnCanTriggerClipboardWrite(const GURL& url,
extension->HasAPIPermission(ExtensionAPIPermission::kClipboardWrite));
}
-void ChromeRenderMessageFilter::OnClearPredictorCache(int* result) {
- // This function is disabled unless the user has enabled
- // benchmarking extensions.
- chrome_browser_net::Predictor* predictor = profile_->GetNetworkPredictor();
- if (predictor)
- predictor->DiscardAllResults();
- *result = 0;
-}
-
void ChromeRenderMessageFilter::OnGetCookies(
const GURL& url,
const GURL& first_party_for_cookies,
diff --git a/chrome/browser/renderer_host/chrome_render_message_filter.h b/chrome/browser/renderer_host/chrome_render_message_filter.h
index cd64c14..adfcf44 100644
--- a/chrome/browser/renderer_host/chrome_render_message_filter.h
+++ b/chrome/browser/renderer_host/chrome_render_message_filter.h
@@ -119,7 +119,6 @@ class ChromeRenderMessageFilter : public BrowserMessageFilter {
ContentSetting* setting);
void OnCanTriggerClipboardRead(const GURL& url, bool* allowed);
void OnCanTriggerClipboardWrite(const GURL& url, bool* allowed);
- void OnClearPredictorCache(int* result);
void OnGetCookies(const GURL& url,
const GURL& first_party_for_cookies,
IPC::Message* reply_msg);
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 1a2a1c5..52be050 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -328,6 +328,8 @@
'browser/certificate_viewer.h',
'browser/character_encoding.cc',
'browser/character_encoding.h',
+ 'browser/chrome_benchmarking_message_filter.cc',
+ 'browser/chrome_benchmarking_message_filter.h',
'browser/chrome_browser_application_mac.h',
'browser/chrome_browser_application_mac.mm',
'browser/chrome_browser_main.cc',
diff --git a/chrome/chrome_renderer.gypi b/chrome/chrome_renderer.gypi
index 63195b1..5151ed0 100644
--- a/chrome/chrome_renderer.gypi
+++ b/chrome/chrome_renderer.gypi
@@ -56,6 +56,8 @@
'renderer/automation/dom_automation_controller.h',
'renderer/automation/dom_automation_v8_extension.cc',
'renderer/automation/dom_automation_v8_extension.h',
+ 'renderer/benchmarking_extension.cc',
+ 'renderer/benchmarking_extension.h',
'renderer/extensions/bindings_utils.cc',
'renderer/extensions/bindings_utils.h',
'renderer/extensions/chrome_app_bindings.cc',
diff --git a/chrome/common/benchmarking_messages.h b/chrome/common/benchmarking_messages.h
new file mode 100644
index 0000000..beaefea
--- /dev/null
+++ b/chrome/common/benchmarking_messages.h
@@ -0,0 +1,50 @@
+// 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.
+
+// Multiply-included file, no traditional include guard.
+
+#include <string>
+
+#include "base/basictypes.h"
+#include "build/build_config.h"
+
+#include "ipc/ipc_message_macros.h"
+#include "ui/gfx/native_widget_types.h"
+
+#define IPC_MESSAGE_START ChromeBenchmarkingMsgStart
+
+// Message sent from the renderer to the browser to request that the browser
+// close all sockets. Used for debugging/testing.
+IPC_MESSAGE_CONTROL0(ChromeViewHostMsg_CloseCurrentConnections)
+
+// Message sent from the renderer to the browser to request that the browser
+// enable or disable the cache. Used for debugging/testing.
+IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_SetCacheMode,
+ bool /* enabled */)
+
+// Message sent from the renderer to the browser to request that the browser
+// clear the cache. Used for debugging/testing.
+// |preserve_ssl_host_info| controls whether clearing the cache will preserve
+// persisted SSL information stored in the cache.
+// |result| is the returned status from the operation.
+IPC_SYNC_MESSAGE_CONTROL1_1(ChromeViewHostMsg_ClearCache,
+ bool /* preserve_ssl_host_info */,
+ int /* result */)
+
+// Message sent from the renderer to the browser to request that the browser
+// clear the host cache. Used for debugging/testing.
+// |result| is the returned status from the operation.
+IPC_SYNC_MESSAGE_CONTROL0_1(ChromeViewHostMsg_ClearHostResolverCache,
+ int /* result */)
+
+// Message sent from the renderer to the browser to request that the browser
+// enable or disable spdy. Used for debugging/testing/benchmarking.
+IPC_MESSAGE_CONTROL1(ChromeViewHostMsg_EnableSpdy,
+ bool /* enable */)
+
+// Message sent from the renderer to the browser to request that the browser
+// clear the predictor cache. Used for debugging/testing.
+// |result| is the returned status from the operation.
+IPC_SYNC_MESSAGE_CONTROL0_1(ChromeViewHostMsg_ClearPredictorCache,
+ int /* result */)
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 61a167e..a9fa984 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -1209,6 +1209,9 @@ const char kDisablePrintPreview[] = "disable-print-preview";
// kDisablePrintPreview overrides this.
const char kEnablePrintPreview[] = "enable-print-preview";
+// Enables the benchmarking extensions.
+const char kEnableBenchmarking[] = "enable-benchmarking";
+
bool IsPrintPreviewEnabled() {
if (CommandLine::ForCurrentProcess()->HasSwitch(kDisablePrintPreview))
return false;
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index d3348e7..85521283 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -352,6 +352,7 @@ extern const char kExposePrivateExtensionApi[];
extern const char kDisablePrintPreview[];
extern const char kEnablePrintPreview[];
+extern const char kEnableBenchmarking[];
bool IsPrintPreviewEnabled();
diff --git a/chrome/common/common_message_generator.h b/chrome/common/common_message_generator.h
index 44128db..4b231f2 100644
--- a/chrome/common/common_message_generator.h
+++ b/chrome/common/common_message_generator.h
@@ -5,6 +5,7 @@
// Multiply-included file, hence no include guard.
#include "chrome/common/autofill_messages.h"
+#include "chrome/common/benchmarking_messages.h"
#include "chrome/common/chrome_plugin_messages.h"
#include "chrome/common/chrome_utility_messages.h"
#include "chrome/common/extensions/extension_messages.h"
diff --git a/webkit/extensions/v8/benchmarking_extension.cc b/chrome/renderer/benchmarking_extension.cc
index f3f4c72..9b65d57 100644
--- a/webkit/extensions/v8/benchmarking_extension.cc
+++ b/chrome/renderer/benchmarking_extension.cc
@@ -2,10 +2,12 @@
// 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 "chrome/renderer/benchmarking_extension.h"
#include "base/metrics/stats_table.h"
#include "base/time.h"
+#include "chrome/common/benchmarking_messages.h"
+#include "content/common/child_thread.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h"
#include "v8/include/v8.h"
#include "webkit/glue/webkit_glue.h"
@@ -100,7 +102,8 @@ class BenchmarkingWrapper : public v8::Extension {
}
static v8::Handle<v8::Value> CloseConnections(const v8::Arguments& args) {
- webkit_glue::CloseCurrentConnections();
+ ChildThread::current()->Send(
+ new ChromeViewHostMsg_CloseCurrentConnections());
return v8::Undefined();
}
@@ -108,20 +111,26 @@ class BenchmarkingWrapper : public v8::Extension {
bool preserve_ssl_host_entries = false;
if (args.Length() && args[0]->IsBoolean())
preserve_ssl_host_entries = args[0]->BooleanValue();
- webkit_glue::ClearCache(preserve_ssl_host_entries);
+ int rv;
+ ChildThread::current()->Send(new ChromeViewHostMsg_ClearCache(
+ preserve_ssl_host_entries, &rv));
WebCache::clear();
return v8::Undefined();
}
static v8::Handle<v8::Value> ClearHostResolverCache(
const v8::Arguments& args) {
- webkit_glue::ClearHostResolverCache();
+ int rv;
+ ChildThread::current()->Send(
+ new ChromeViewHostMsg_ClearHostResolverCache(&rv));
return v8::Undefined();
}
static v8::Handle<v8::Value> ClearPredictorCache(
const v8::Arguments& args) {
- webkit_glue::ClearPredictorCache();
+ int rv;
+ ChildThread::current()->Send(new ChromeViewHostMsg_ClearPredictorCache(
+ &rv));
return v8::Undefined();
}
@@ -129,7 +138,8 @@ class BenchmarkingWrapper : public v8::Extension {
if (!args.Length() || !args[0]->IsBoolean())
return v8::Undefined();
- webkit_glue::EnableSpdy(args[0]->BooleanValue());
+ ChildThread::current()->Send(new ChromeViewHostMsg_EnableSpdy(
+ args[0]->BooleanValue()));
return v8::Undefined();
}
diff --git a/webkit/extensions/v8/benchmarking_extension.h b/chrome/renderer/benchmarking_extension.h
index 3aa5cee..0824062 100644
--- a/webkit/extensions/v8/benchmarking_extension.h
+++ b/chrome/renderer/benchmarking_extension.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef WEBKIT_EXTENSIONS_V8_BENCHMARKING_EXTENSION_H_
-#define WEBKIT_EXTENSIONS_V8_BENCHMARKING_EXTENSION_H_
+#ifndef CHROME_RENDERER_V8_BENCHMARKING_EXTENSION_H_
+#define CHROME_RENDERER_V8_BENCHMARKING_EXTENSION_H_
#pragma once
namespace v8 {
@@ -22,4 +22,5 @@ class BenchmarkingExtension {
} // namespace extensions_v8
-#endif // WEBKIT_EXTENSIONS_V8_BENCHMARKING_EXTENSION_H_
+#endif // CHROME_RENDERER_V8_BENCHMARKING_EXTENSION_H_
+
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index b53f990..e8c6d57 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -28,6 +28,7 @@
#include "chrome/renderer/autofill/password_autofill_manager.h"
#include "chrome/renderer/automation/automation_renderer_helper.h"
#include "chrome/renderer/automation/dom_automation_v8_extension.h"
+#include "chrome/renderer/benchmarking_extension.h"
#include "chrome/renderer/blocked_plugin.h"
#include "chrome/renderer/chrome_ppapi_interfaces.h"
#include "chrome/renderer/chrome_render_process_observer.h"
@@ -188,6 +189,10 @@ void ChromeContentRendererClient::RenderThreadStarted() {
}
if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableBenchmarking))
+ thread->RegisterExtension(extensions_v8::BenchmarkingExtension::Get());
+
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableIPCFuzzing)) {
thread->channel()->set_outgoing_message_filter(LoadExternalIPCFuzzer());
}
diff --git a/content/app/content_main.cc b/content/app/content_main.cc
index b124193..12cc816 100644
--- a/content/app/content_main.cc
+++ b/content/app/content_main.cc
@@ -157,8 +157,7 @@ void InitializeStatsTable(base::ProcessId browser_pid,
// Chrome. These lines can be commented out to effectively turn
// counters 'off'. The table is created and exists for the life
// of the process. It is not cleaned up.
- if (command_line.HasSwitch(switches::kEnableStatsTable) ||
- command_line.HasSwitch(switches::kEnableBenchmarking)) {
+ if (command_line.HasSwitch(switches::kEnableStatsTable)) {
// NOTIMPLEMENTED: we probably need to shut this down correctly to avoid
// leaking shared memory regions on posix platforms.
std::string statsfile =
diff --git a/content/browser/browser_main.cc b/content/browser/browser_main.cc
index 2e165ec..5b0aa63 100644
--- a/content/browser/browser_main.cc
+++ b/content/browser/browser_main.cc
@@ -192,8 +192,6 @@ void BrowserMainParts::EarlyInitialization() {
SetupSandbox(parsed_command_line());
#endif
- if (parsed_command_line().HasSwitch(switches::kEnableBenchmarking))
- base::FieldTrial::EnableBenchmarking();
if (parsed_command_line().HasSwitch(switches::kDisableSSLFalseStart))
net::SSLConfigService::DisableFalseStart();
if (parsed_command_line().HasSwitch(switches::kEnableSSLCachedInfo))
diff --git a/content/browser/renderer_host/browser_render_process_host.cc b/content/browser/renderer_host/browser_render_process_host.cc
index 2ff2c51..8578251 100644
--- a/content/browser/renderer_host/browser_render_process_host.cc
+++ b/content/browser/renderer_host/browser_render_process_host.cc
@@ -556,7 +556,6 @@ void BrowserRenderProcessHost::PropagateBrowserCommandLineToRenderer(
switches::kDisableWebSockets,
switches::kEnableAccessibilityLogging,
switches::kEnableAdaptive,
- switches::kEnableBenchmarking,
switches::kEnableDCHECK,
switches::kEnableGPUServiceLogging,
switches::kEnableGPUClientLogging,
diff --git a/content/browser/renderer_host/render_message_filter.cc b/content/browser/renderer_host/render_message_filter.cc
index 5037a66..3540f2a 100644
--- a/content/browser/renderer_host/render_message_filter.cc
+++ b/content/browser/renderer_host/render_message_filter.cc
@@ -43,10 +43,7 @@
#include "net/base/io_buffer.h"
#include "net/base/keygen_handler.h"
#include "net/base/mime_util.h"
-#include "net/base/net_errors.h"
-#include "net/disk_cache/disk_cache.h"
#include "net/http/http_cache.h"
-#include "net/http/http_network_layer.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebNotificationPresenter.h"
@@ -104,20 +101,6 @@ class RenderMessageCompletionCallback {
IPC::Message* reply_msg_;
};
-class ClearCacheCompletion : public RenderMessageCompletionCallback,
- public net::CompletionCallback {
- public:
- ClearCacheCompletion(RenderMessageFilter* filter,
- IPC::Message* reply_msg)
- : RenderMessageCompletionCallback(filter, reply_msg) {
- }
-
- virtual void RunWithParams(const Tuple1<int>& params) {
- ViewHostMsg_ClearCache::WriteReplyParams(reply_msg(), params.a);
- SendReplyAndDeleteThis();
- }
-};
-
class OpenChannelToPpapiPluginCallback : public RenderMessageCompletionCallback,
public PpapiPluginProcessHost::Client {
public:
@@ -182,55 +165,6 @@ class OpenChannelToPpapiBrokerCallback : public PpapiBrokerProcessHost::Client {
int request_id_;
};
-// Class to assist with clearing out the cache when we want to preserve
-// the sslhostinfo entries. It's not very efficient, but its just for debug.
-class DoomEntriesHelper {
- public:
- explicit DoomEntriesHelper(disk_cache::Backend* backend)
- : backend_(backend),
- entry_(NULL),
- iter_(NULL),
- ALLOW_THIS_IN_INITIALIZER_LIST(callback_(this,
- &DoomEntriesHelper::CacheCallback)),
- user_callback_(NULL) {
- }
-
- void ClearCache(ClearCacheCompletion* callback) {
- user_callback_ = callback;
- return CacheCallback(net::OK); // Start clearing the cache.
- }
-
- private:
- void CacheCallback(int result) {
- do {
- if (result != net::OK) {
- user_callback_->RunWithParams(Tuple1<int>(result));
- delete this;
- return;
- }
-
- if (entry_) {
- // Doom all entries except those with snapstart information.
- std::string key = entry_->GetKey();
- if (key.find("sslhostinfo:") != 0) {
- entry_->Doom();
- backend_->EndEnumeration(&iter_);
- iter_ = NULL; // We invalidated our iterator - start from the top!
- }
- entry_->Close();
- entry_ = NULL;
- }
- result = backend_->OpenNextEntry(&iter_, &entry_, &callback_);
- } while (result != net::ERR_IO_PENDING);
- }
-
- disk_cache::Backend* backend_;
- disk_cache::Entry* entry_;
- void* iter_;
- net::CompletionCallbackImpl<DoomEntriesHelper> callback_;
- ClearCacheCompletion* user_callback_;
-};
-
} // namespace
class RenderMessageFilter::OpenChannelToNpapiPluginCallback
@@ -414,15 +348,8 @@ bool RenderMessageFilter::OnMessageReceived(const IPC::Message& message,
IPC_MESSAGE_HANDLER(ViewHostMsg_AllocTransportDIB, OnAllocTransportDIB)
IPC_MESSAGE_HANDLER(ViewHostMsg_FreeTransportDIB, OnFreeTransportDIB)
#endif
- IPC_MESSAGE_HANDLER(ViewHostMsg_CloseCurrentConnections,
- OnCloseCurrentConnections)
- IPC_MESSAGE_HANDLER(ViewHostMsg_SetCacheMode, OnSetCacheMode)
- IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_ClearCache, OnClearCache)
- IPC_MESSAGE_HANDLER(ViewHostMsg_ClearHostResolverCache,
- OnClearHostResolverCache)
IPC_MESSAGE_HANDLER(ViewHostMsg_DidGenerateCacheableMetadata,
OnCacheableMetadataAvailable)
- IPC_MESSAGE_HANDLER(ViewHostMsg_EnableSpdy, OnEnableSpdy)
IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_Keygen, OnKeygen)
IPC_MESSAGE_HANDLER(ViewHostMsg_AsyncOpenFile, OnAsyncOpenFile)
IPC_MESSAGE_HANDLER(ViewHostMsg_GetHardwareSampleRate,
@@ -710,85 +637,6 @@ void RenderMessageFilter::OnFreeTransportDIB(
}
#endif
-bool RenderMessageFilter::CheckBenchmarkingEnabled() const {
- static bool checked = false;
- static bool result = false;
- if (!checked) {
- const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- result = command_line.HasSwitch(switches::kEnableBenchmarking);
- checked = true;
- }
- return result;
-}
-
-void RenderMessageFilter::OnCloseCurrentConnections() {
- // This function is disabled unless the user has enabled
- // benchmarking extensions.
- if (!CheckBenchmarkingEnabled())
- return;
- request_context_->GetURLRequestContext()->
- http_transaction_factory()->GetCache()->CloseAllConnections();
-}
-
-void RenderMessageFilter::OnSetCacheMode(bool enabled) {
- // This function is disabled unless the user has enabled
- // benchmarking extensions.
- if (!CheckBenchmarkingEnabled())
- return;
-
- net::HttpCache::Mode mode = enabled ?
- net::HttpCache::NORMAL : net::HttpCache::DISABLE;
- net::HttpCache* http_cache = request_context_->GetURLRequestContext()->
- http_transaction_factory()->GetCache();
- http_cache->set_mode(mode);
-}
-
-void RenderMessageFilter::OnClearCache(bool preserve_ssl_host_info,
- IPC::Message* reply_msg) {
- // This function is disabled unless the user has enabled
- // benchmarking extensions.
- int rv = -1;
- if (CheckBenchmarkingEnabled()) {
- disk_cache::Backend* backend = request_context_->GetURLRequestContext()->
- http_transaction_factory()->GetCache()->GetCurrentBackend();
- if (backend) {
- ClearCacheCompletion* callback =
- new ClearCacheCompletion(this, reply_msg);
- if (preserve_ssl_host_info) {
- DoomEntriesHelper* helper = new DoomEntriesHelper(backend);
- helper->ClearCache(callback); // Will self clean.
- return;
- } else {
- rv = backend->DoomAllEntries(callback);
- if (rv == net::ERR_IO_PENDING) {
- // The callback will send the reply.
- return;
- }
- // Completed synchronously, no need for the callback.
- delete callback;
- }
- }
- }
- ViewHostMsg_ClearCache::WriteReplyParams(reply_msg, rv);
- Send(reply_msg);
-}
-
-void RenderMessageFilter::OnClearHostResolverCache(int* result) {
- // This function is disabled unless the user has enabled
- // benchmarking extensions.
- *result = -1;
- DCHECK(CheckBenchmarkingEnabled());
- net::HostResolverImpl* host_resolver_impl =
- request_context_->GetURLRequestContext()->
- host_resolver()->GetAsHostResolverImpl();
- if (host_resolver_impl) {
- net::HostCache* cache = host_resolver_impl->cache();
- DCHECK(cache);
- cache->clear();
- *result = 0;
- }
-}
-
bool RenderMessageFilter::CheckPreparsedJsCachingEnabled() const {
static bool checked = false;
static bool result = false;
@@ -817,16 +665,6 @@ void RenderMessageFilter::OnCacheableMetadataAvailable(
url, base::Time::FromDoubleT(expected_response_time), buf, data.size());
}
-// TODO(lzheng): This only enables spdy over ssl. Enable spdy for http
-// when needed.
-void RenderMessageFilter::OnEnableSpdy(bool enable) {
- if (enable) {
- net::HttpNetworkLayer::EnableSpdy("npn,force-alt-protocols");
- } else {
- net::HttpNetworkLayer::EnableSpdy("npn-http");
- }
-}
-
void RenderMessageFilter::OnKeygen(uint32 key_size_index,
const std::string& challenge_string,
const GURL& url,
diff --git a/content/browser/renderer_host/render_message_filter.h b/content/browser/renderer_host/render_message_filter.h
index 5d63975..70a0d8f 100644
--- a/content/browser/renderer_host/render_message_filter.h
+++ b/content/browser/renderer_host/render_message_filter.h
@@ -191,14 +191,9 @@ class RenderMessageFilter : public BrowserMessageFilter {
bool cache_in_browser,
TransportDIB::Handle* result);
void OnFreeTransportDIB(TransportDIB::Id dib_id);
- void OnCloseCurrentConnections();
- void OnSetCacheMode(bool enabled);
- void OnClearCache(bool preserve_ssl_host_info, IPC::Message* reply_msg);
- void OnClearHostResolverCache(int* result);
void OnCacheableMetadataAvailable(const GURL& url,
double expected_response_time,
const std::vector<char>& data);
- void OnEnableSpdy(bool enable);
void OnKeygen(uint32 key_size_index, const std::string& challenge_string,
const GURL& url, IPC::Message* reply_msg);
void OnKeygenOnWorkerThread(
diff --git a/content/common/content_switches.cc b/content/common/content_switches.cc
index 0587a60..afe8ca1 100644
--- a/content/common/content_switches.cc
+++ b/content/common/content_switches.cc
@@ -174,9 +174,6 @@ const char kEnableAccessibility[] = "enable-accessibility";
// Turns on extremely verbose logging of accessibility events.
const char kEnableAccessibilityLogging[] = "enable-accessibility-logging";
-// Enables the benchmarking extensions.
-const char kEnableBenchmarking[] = "enable-benchmarking";
-
// Enable DNS side checking of certificates. Still experimental, should only
// be used by developers at the current time.
const char kEnableDNSCertProvenanceChecking[] =
diff --git a/content/common/content_switches.h b/content/common/content_switches.h
index eef89e0..b9f1bb3 100644
--- a/content/common/content_switches.h
+++ b/content/common/content_switches.h
@@ -65,7 +65,6 @@ extern const char kEnableAccelerated2dCanvas[];
CONTENT_EXPORT extern const char kEnableAcceleratedDrawing[];
extern const char kEnableAccessibility[];
extern const char kEnableAccessibilityLogging[];
-CONTENT_EXPORT extern const char kEnableBenchmarking[];
CONTENT_EXPORT extern const char kEnableDNSCertProvenanceChecking[];
CONTENT_EXPORT extern const char kEnableDeviceMotion[];
CONTENT_EXPORT extern const char kDisableFullScreen[];
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index 25ca41b..1165ffc 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -2026,41 +2026,6 @@ IPC_SYNC_MESSAGE_CONTROL3_1(ViewHostMsg_Keygen,
std::string /* signed public key and challenge */)
// Message sent from the renderer to the browser to request that the browser
-// close all sockets. Used for debugging/testing.
-IPC_MESSAGE_CONTROL0(ViewHostMsg_CloseCurrentConnections)
-
-// Message sent from the renderer to the browser to request that the browser
-// enable or disable the cache. Used for debugging/testing.
-IPC_MESSAGE_CONTROL1(ViewHostMsg_SetCacheMode,
- bool /* enabled */)
-
-// Message sent from the renderer to the browser to request that the browser
-// clear the cache. Used for debugging/testing.
-// |preserve_ssl_host_info| controls whether clearing the cache will preserve
-// persisted SSL information stored in the cache.
-// |result| is the returned status from the operation.
-IPC_SYNC_MESSAGE_CONTROL1_1(ViewHostMsg_ClearCache,
- bool /* preserve_ssl_host_info */,
- int /* result */)
-
-// Message sent from the renderer to the browser to request that the browser
-// clear the host cache. Used for debugging/testing.
-// |result| is the returned status from the operation.
-IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_ClearHostResolverCache,
- int /* result */)
-
-// Message sent from the renderer to the browser to request that the browser
-// clear the predictor cache. Used for debugging/testing.
-// |result| is the returned status from the operation.
-IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_ClearPredictorCache,
- int /* result */)
-
-// Message sent from the renderer to the browser to request that the browser
-// enable or disable spdy. Used for debugging/testing/benchmarking.
-IPC_MESSAGE_CONTROL1(ViewHostMsg_EnableSpdy,
- bool /* enable */)
-
-// Message sent from the renderer to the browser to request that the browser
// cache |data| associated with |url|.
IPC_MESSAGE_CONTROL3(ViewHostMsg_DidGenerateCacheableMetadata,
GURL /* url */,
diff --git a/content/renderer/render_thread.cc b/content/renderer/render_thread.cc
index 4556c2f..376232a 100644
--- a/content/renderer/render_thread.cc
+++ b/content/renderer/render_thread.cc
@@ -66,7 +66,6 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
#include "v8/include/v8.h"
-#include "webkit/extensions/v8/benchmarking_extension.h"
#include "webkit/extensions/v8/playback_extension.h"
#include "webkit/glue/webkit_glue.h"
@@ -432,9 +431,6 @@ void RenderThread::EnsureWebKitInitialized() {
webkit_glue::EnableWebCoreLogChannels(
command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels));
- if (command_line.HasSwitch(switches::kEnableBenchmarking))
- RegisterExtension(extensions_v8::BenchmarkingExtension::Get());
-
if (command_line.HasSwitch(switches::kPlaybackMode) ||
command_line.HasSwitch(switches::kRecordMode) ||
command_line.HasSwitch(switches::kNoJsRandomness)) {
@@ -587,33 +583,6 @@ void RenderThread::OnCreateNewView(const ViewMsg_New_Params& params) {
params.frame_name);
}
-void RenderThread::CloseCurrentConnections() {
- Send(new ViewHostMsg_CloseCurrentConnections());
-}
-
-void RenderThread::SetCacheMode(bool enabled) {
- Send(new ViewHostMsg_SetCacheMode(enabled));
-}
-
-void RenderThread::ClearCache(bool preserve_ssl_host_info) {
- int rv;
- Send(new ViewHostMsg_ClearCache(preserve_ssl_host_info, &rv));
-}
-
-void RenderThread::ClearHostResolverCache() {
- int rv;
- Send(new ViewHostMsg_ClearHostResolverCache(&rv));
-}
-
-void RenderThread::ClearPredictorCache() {
- int rv;
- Send(new ViewHostMsg_ClearPredictorCache(&rv));
-}
-
-void RenderThread::EnableSpdy(bool enable) {
- Send(new ViewHostMsg_EnableSpdy(enable));
-}
-
GpuChannelHost* RenderThread::EstablishGpuChannelSync(
content::CauseForGpuLaunch cause_for_gpu_launch) {
if (gpu_channel_.get()) {
diff --git a/content/renderer/render_thread.h b/content/renderer/render_thread.h
index da651ef..351cbcb 100644
--- a/content/renderer/render_thread.h
+++ b/content/renderer/render_thread.h
@@ -190,26 +190,6 @@ class CONTENT_EXPORT RenderThread : public RenderThreadBase,
idle_notification_delay_in_s_ = idle_notification_delay_in_s;
}
- // Sends a message to the browser to close all connections.
- void CloseCurrentConnections();
-
- // Sends a message to the browser to enable or disable the disk cache.
- void SetCacheMode(bool enabled);
-
- // Sends a message to the browser to clear the disk cache.
- // |preserve_ssl_host_info| is a flag indicating if the cache should purge
- // entries related to cached SSL information.
- void ClearCache(bool preserve_ssl_host_info);
-
- // Sends a message to the browser to clear thed host cache.
- void ClearHostResolverCache();
-
- // Sends a message to the browser to clear the predictor cache.
- void ClearPredictorCache();
-
- // Sends a message to the browser to enable/disable spdy.
- void EnableSpdy(bool enable);
-
// Synchronously establish a channel to the GPU plugin if not previously
// established or if it has been lost (for example if the GPU plugin crashed).
// If there is a pending asynchronous request, it will be completed by the
diff --git a/content/renderer/renderer_glue.cc b/content/renderer/renderer_glue.cc
index 93db367..8f20b36 100644
--- a/content/renderer/renderer_glue.cc
+++ b/content/renderer/renderer_glue.cc
@@ -225,34 +225,10 @@ WebSocketStreamHandleBridge* WebSocketStreamHandleBridge::Create(
return dispatcher->CreateBridge(handle, delegate);
}
-void CloseCurrentConnections() {
- RenderThread::current()->CloseCurrentConnections();
-}
-
-void SetCacheMode(bool enabled) {
- RenderThread::current()->SetCacheMode(enabled);
-}
-
-void ClearCache(bool preserve_ssl_host_info) {
- RenderThread::current()->ClearCache(preserve_ssl_host_info);
-}
-
-void ClearHostResolverCache() {
- RenderThread::current()->ClearHostResolverCache();
-}
-
-void ClearPredictorCache() {
- RenderThread::current()->ClearPredictorCache();
-}
-
bool IsSingleProcess() {
return CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess);
}
-void EnableSpdy(bool enable) {
- RenderThread::current()->EnableSpdy(enable);
-}
-
#if defined(OS_LINUX)
int MatchFontWithFallback(const std::string& face, bool bold,
bool italic, int charset) {
diff --git a/ipc/ipc_message_utils.h b/ipc/ipc_message_utils.h
index 7c46f90..9c93ce7 100644
--- a/ipc/ipc_message_utils.h
+++ b/ipc/ipc_message_utils.h
@@ -94,6 +94,7 @@ enum IPCMessageStart {
ChromeUtilityMsgStart,
MediaStreamMsgStart,
ChromePluginMsgStart,
+ ChromeBenchmarkingMsgStart,
LastIPCMsgStart // Must come last.
};
diff --git a/webkit/glue/webkit_glue.gypi b/webkit/glue/webkit_glue.gypi
index 025c3f6..0938301 100644
--- a/webkit/glue/webkit_glue.gypi
+++ b/webkit/glue/webkit_glue.gypi
@@ -430,8 +430,6 @@
# These files used to be built in the webcore target, but moved here
# since part of glue.
- '../extensions/v8/benchmarking_extension.cc',
- '../extensions/v8/benchmarking_extension.h',
'../extensions/v8/gc_extension.cc',
'../extensions/v8/gc_extension.h',
'../extensions/v8/heap_profiler_extension.cc',
diff --git a/webkit/glue/webkit_glue.h b/webkit/glue/webkit_glue.h
index 8e5ea40..54cfdc1 100644
--- a/webkit/glue/webkit_glue.h
+++ b/webkit/glue/webkit_glue.h
@@ -215,30 +215,9 @@ bool IsProtocolSupportedForMedia(const GURL& url);
// the form language-country (e.g., en-US or pt-BR).
std::string GetWebKitLocale();
-// Close current connections. Used for debugging.
-void CloseCurrentConnections();
-
-// Enable or disable the disk cache. Used for debugging.
-void SetCacheMode(bool enabled);
-
-// Clear the disk cache. Used for debugging.
-// |preserve_ssl_host_info| indicates whether disk cache entries related to
-// SSL information should be purged.
-void ClearCache(bool preserve_ssl_host_info);
-
-// Clear the host resolver cache. Used for debugging.
-void ClearHostResolverCache();
-
-// Clear the predictor cache (for DNS prefetch and preconnect). Used for
-// debugging.
-void ClearPredictorCache();
-
// Returns true if the embedder is running in single process mode.
bool IsSingleProcess();
-// Enables/Disables Spdy for requests afterwards. Used for benchmarking.
-void EnableSpdy(bool enable);
-
#if defined(OS_LINUX)
// Return a read-only file descriptor to the font which best matches the given
// properties or -1 on failure.
diff --git a/webkit/support/webkit_support_glue.cc b/webkit/support/webkit_support_glue.cc
index 968b649..501356e 100644
--- a/webkit/support/webkit_support_glue.cc
+++ b/webkit/support/webkit_support_glue.cc
@@ -53,21 +53,6 @@ std::string GetWebKitLocale() {
return "en-US";
}
-void CloseCurrentConnections() {
-}
-
-void SetCacheMode(bool enabled) {
-}
-
-void ClearCache(bool preserve_ssl_info) {
-}
-
-void ClearHostResolverCache() {
-}
-
-void ClearPredictorCache() {
-}
-
std::string BuildUserAgent(bool mimic_windows) {
return webkit_glue::BuildUserAgentHelper(mimic_windows,
"DumpRenderTree/0.0.0.0");
diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc
index d4315a7..7c78dbc 100644
--- a/webkit/tools/test_shell/test_shell.cc
+++ b/webkit/tools/test_shell/test_shell.cc
@@ -639,30 +639,6 @@ std::string GetWebKitLocale() {
return "en-US";
}
-void CloseCurrentConnections() {
- // Used in benchmarking, Ignored for test_shell.
-}
-
-void SetCacheMode(bool enabled) {
- // Used in benchmarking, Ignored for test_shell.
-}
-
-void ClearCache(bool preserve_ssl_entries) {
- // Used in benchmarking, Ignored for test_shell.
-}
-
-void ClearHostResolverCache() {
- // Used in benchmarking, Ignored for test_shell.
-}
-
-void ClearPredictorCache() {
- // Used in benchmarking, Ignored for test_shell.
-}
-
-void EnableSpdy(bool enable) {
- // Used in benchmarking, Ignored for test_shell.
-}
-
std::string BuildUserAgent(bool mimic_windows) {
return webkit_glue::BuildUserAgentHelper(mimic_windows, "Chrome/0.0.0.0");
}