summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-18 07:04:46 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-18 07:04:46 +0000
commit7db7581ccba3b06045295e7c3ca8a79703892fbb (patch)
treebffca8721023268c881e1d95adbff23b7d4970ef
parentf0eb3d567ad9a7e98504e0a5981fa7f0ff6d4a18 (diff)
downloadchromium_src-7db7581ccba3b06045295e7c3ca8a79703892fbb.zip
chromium_src-7db7581ccba3b06045295e7c3ca8a79703892fbb.tar.gz
chromium_src-7db7581ccba3b06045295e7c3ca8a79703892fbb.tar.bz2
More removal of config.h and glue_util.h dependencies.
I killed the #if ENABLE(WORKERS) defines in favor of always compiling that code because it is harmless to compile it when the underlying WebCore implementation is not compiled, thanks to the WebKit API. R=yaar BUG=none TEST=none Review URL: http://codereview.chromium.org/404023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32303 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--webkit/glue/glue_serialize.cc1
-rw-r--r--webkit/glue/multipart_response_delegate_unittest.cc26
-rw-r--r--webkit/glue/simple_webmimeregistry_impl.cc1
-rw-r--r--webkit/glue/webpasswordautocompletelistener_unittest.cc1
-rw-r--r--webkit/glue/weburlloader_impl.cc24
-rw-r--r--webkit/tools/test_shell/event_sending_controller.cc30
-rw-r--r--webkit/tools/test_shell/test_web_worker.h4
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.cc8
8 files changed, 32 insertions, 63 deletions
diff --git a/webkit/glue/glue_serialize.cc b/webkit/glue/glue_serialize.cc
index a0009f8..f10fc8a 100644
--- a/webkit/glue/glue_serialize.cc
+++ b/webkit/glue/glue_serialize.cc
@@ -15,7 +15,6 @@
#include "third_party/WebKit/WebKit/chromium/public/WebPoint.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
#include "third_party/WebKit/WebKit/chromium/public/WebVector.h"
-#include "webkit/glue/glue_util.h"
#include "webkit/glue/webkit_glue.h"
using WebKit::WebData;
diff --git a/webkit/glue/multipart_response_delegate_unittest.cc b/webkit/glue/multipart_response_delegate_unittest.cc
index 846f323..27a3629 100644
--- a/webkit/glue/multipart_response_delegate_unittest.cc
+++ b/webkit/glue/multipart_response_delegate_unittest.cc
@@ -9,7 +9,6 @@
#include "third_party/WebKit/WebKit/chromium/public/WebURL.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURLLoaderClient.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h"
-#include "webkit/glue/glue_util.h"
#include "webkit/glue/multipart_response_delegate.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -82,6 +81,10 @@ class MockWebURLLoaderClient : public WebURLLoaderClient {
response_.reset();
}
+ string GetResponseHeader(const char* name) const {
+ return string(response_.httpHeaderField(WebString::fromUTF8(name)).utf8());
+ }
+
int received_response_, received_data_;
string data_;
WebURLResponse response_;
@@ -160,18 +163,10 @@ TEST(MultipartResponseTest, Functions) {
delegate_tester.data().assign(test_header);
EXPECT_TRUE(delegate_tester.ParseHeaders());
EXPECT_TRUE(delegate_tester.data().length() == 0);
- EXPECT_EQ(string("image/png"),
- webkit_glue::WebStringToStdString(
- client.response_.httpHeaderField(
- WebString::fromUTF8("Content-Type"))));
- EXPECT_EQ(string("10"),
- webkit_glue::WebStringToStdString(
- client.response_.httpHeaderField(
- WebString::fromUTF8("content-length"))));
+ EXPECT_EQ(string("image/png"), client.GetResponseHeader("Content-Type"));
+ EXPECT_EQ(string("10"), client.GetResponseHeader("content-length"));
// This header is passed from the original request.
- EXPECT_EQ(string("Bar"),
- webkit_glue::WebStringToStdString(
- client.response_.httpHeaderField(WebString::fromUTF8("foo"))));
+ EXPECT_EQ(string("Bar"), client.GetResponseHeader("foo"));
// Make sure we parse the right mime-type if a charset is provided.
client.Reset();
@@ -180,12 +175,9 @@ TEST(MultipartResponseTest, Functions) {
EXPECT_TRUE(delegate_tester.ParseHeaders());
EXPECT_TRUE(delegate_tester.data().length() == 0);
EXPECT_EQ(string("text/html; charset=utf-8"),
- webkit_glue::WebStringToStdString(
- client.response_.httpHeaderField(
- WebString::fromUTF8("Content-Type"))));
+ client.GetResponseHeader("Content-Type"));
EXPECT_EQ(string("utf-8"),
- webkit_glue::WebStringToStdString(
- client.response_.textEncodingName()));
+ string(client.response_.textEncodingName().utf8()));
// FindBoundary tests
struct {
diff --git a/webkit/glue/simple_webmimeregistry_impl.cc b/webkit/glue/simple_webmimeregistry_impl.cc
index 83022c1..2c67a0b 100644
--- a/webkit/glue/simple_webmimeregistry_impl.cc
+++ b/webkit/glue/simple_webmimeregistry_impl.cc
@@ -8,7 +8,6 @@
#include "base/sys_string_conversions.h"
#include "net/base/mime_util.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"
-#include "webkit/glue/glue_util.h"
#include "webkit/glue/webkit_glue.h"
using WebKit::WebString;
diff --git a/webkit/glue/webpasswordautocompletelistener_unittest.cc b/webkit/glue/webpasswordautocompletelistener_unittest.cc
index 86863565..e432e42 100644
--- a/webkit/glue/webpasswordautocompletelistener_unittest.cc
+++ b/webkit/glue/webpasswordautocompletelistener_unittest.cc
@@ -9,7 +9,6 @@
#include <string>
#include "base/string_util.h"
-#include "webkit/glue/glue_util.h"
#include "webkit/glue/webpasswordautocompletelistener_impl.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/webkit/glue/weburlloader_impl.cc b/webkit/glue/weburlloader_impl.cc
index 7a85214..c64ab24 100644
--- a/webkit/glue/weburlloader_impl.cc
+++ b/webkit/glue/weburlloader_impl.cc
@@ -23,7 +23,6 @@
#include "third_party/WebKit/WebKit/chromium/public/WebURLRequest.h"
#include "third_party/WebKit/WebKit/chromium/public/WebURLResponse.h"
#include "webkit/glue/ftp_directory_listing_response_delegate.h"
-#include "webkit/glue/glue_util.h"
#include "webkit/glue/multipart_response_delegate.h"
#include "webkit/glue/resource_loader_bridge.h"
#include "webkit/glue/webkit_glue.h"
@@ -56,8 +55,8 @@ class HeaderFlattener : public WebHTTPHeaderVisitor {
virtual void visitHeader(const WebString& name, const WebString& value) {
// TODO(darin): is UTF-8 really correct here? It is if the strings are
// already ASCII (i.e., if they are already escaped properly).
- const std::string& name_utf8 = WebStringToStdString(name);
- const std::string& value_utf8 = WebStringToStdString(value);
+ const std::string& name_utf8 = name.utf8();
+ const std::string& value_utf8 = value.utf8();
// Skip over referrer headers found in the header map because we already
// pulled it out as a separate parameter. We likewise prune the UA since
@@ -148,8 +147,8 @@ void PopulateURLResponse(
const ResourceLoaderBridge::ResponseInfo& info,
WebURLResponse* response) {
response->setURL(url);
- response->setMIMEType(StdStringToWebString(info.mime_type));
- response->setTextEncodingName(StdStringToWebString(info.charset));
+ response->setMIMEType(WebString::fromUTF8(info.mime_type));
+ response->setTextEncodingName(WebString::fromUTF8(info.charset));
response->setExpectedContentLength(info.content_length);
response->setSecurityInfo(info.security_info);
response->setAppCacheID(info.appcache_id);
@@ -160,7 +159,7 @@ void PopulateURLResponse(
return;
response->setHTTPStatusCode(headers->response_code());
- response->setHTTPStatusText(StdStringToWebString(headers->GetStatusText()));
+ response->setHTTPStatusText(WebString::fromUTF8(headers->GetStatusText()));
// TODO(darin): We should leverage HttpResponseHeaders for this, and this
// should be using the same code as ResourceDispatcherHost.
@@ -180,8 +179,8 @@ void PopulateURLResponse(
void* iter = NULL;
std::string name;
while (headers->EnumerateHeaderLines(&iter, &name, &value)) {
- response->addHTTPHeaderField(StdStringToWebString(name),
- StdStringToWebString(value));
+ response->addHTTPHeaderField(WebString::fromUTF8(name),
+ WebString::fromUTF8(value));
}
}
@@ -283,9 +282,9 @@ void WebURLLoaderImpl::Context::Start(
return;
}
- GURL referrer_url(WebStringToStdString(
- request.httpHeaderField(WebString::fromUTF8("Referer"))));
- const std::string& method = WebStringToStdString(request.httpMethod());
+ GURL referrer_url(
+ request.httpHeaderField(WebString::fromUTF8("Referer")).utf8());
+ const std::string& method = request.httpMethod().utf8();
int load_flags = net::LOAD_NORMAL;
switch (request.cachePolicy()) {
@@ -362,8 +361,7 @@ void WebURLLoaderImpl::Context::Start(
}
break;
case WebHTTPBody::Element::TypeFile:
- bridge_->AppendFileToUpload(
- FilePath(WebStringToFilePathString(element.filePath)));
+ bridge_->AppendFileToUpload(WebStringToFilePath(element.filePath));
break;
default:
NOTREACHED();
diff --git a/webkit/tools/test_shell/event_sending_controller.cc b/webkit/tools/test_shell/event_sending_controller.cc
index 7a2836e..a14ffdf 100644
--- a/webkit/tools/test_shell/event_sending_controller.cc
+++ b/webkit/tools/test_shell/event_sending_controller.cc
@@ -14,13 +14,6 @@
// The behavior of queuing events and replaying them can be disabled by a
// layout test by setting eventSender.dragMode to false.
-// TODO(darin): This is very wrong. We should not be including WebCore headers
-// directly like this!!
-#include "config.h"
-#include "KeyboardCodes.h"
-
-#undef LOG
-
#include "webkit/tools/test_shell/event_sending_controller.h"
#include <queue>
@@ -28,6 +21,7 @@
#include "base/compiler_specific.h"
#include "base/file_path.h"
#include "base/file_util.h"
+#include "base/keyboard_codes.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/string_util.h"
@@ -469,25 +463,25 @@ void EventSendingController::keyDown(
bool needs_shift_key_modifier = false;
if (L"\n" == code_str) {
generate_char = true;
- code = WebCore::VKEY_RETURN;
+ code = base::VKEY_RETURN;
} else if (L"rightArrow" == code_str) {
- code = WebCore::VKEY_RIGHT;
+ code = base::VKEY_RIGHT;
} else if (L"downArrow" == code_str) {
- code = WebCore::VKEY_DOWN;
+ code = base::VKEY_DOWN;
} else if (L"leftArrow" == code_str) {
- code = WebCore::VKEY_LEFT;
+ code = base::VKEY_LEFT;
} else if (L"upArrow" == code_str) {
- code = WebCore::VKEY_UP;
+ code = base::VKEY_UP;
} else if (L"delete" == code_str) {
- code = WebCore::VKEY_BACK;
+ code = base::VKEY_BACK;
} else if (L"pageUp" == code_str) {
- code = WebCore::VKEY_PRIOR;
+ code = base::VKEY_PRIOR;
} else if (L"pageDown" == code_str) {
- code = WebCore::VKEY_NEXT;
+ code = base::VKEY_NEXT;
} else if (L"home" == code_str) {
- code = WebCore::VKEY_HOME;
+ code = base::VKEY_HOME;
} else if (L"end" == code_str) {
- code = WebCore::VKEY_END;
+ code = base::VKEY_END;
} else {
// Compare the input string with the function-key names defined by the
// DOM spec (i.e. "F1",...,"F24"). If the input string is a function-key
@@ -497,7 +491,7 @@ void EventSendingController::keyDown(
function_key_name += L"F";
function_key_name += IntToWString(i);
if (function_key_name == code_str) {
- code = WebCore::VKEY_F1 + (i - 1);
+ code = base::VKEY_F1 + (i - 1);
break;
}
}
diff --git a/webkit/tools/test_shell/test_web_worker.h b/webkit/tools/test_shell/test_web_worker.h
index f83752e..b46288c 100644
--- a/webkit/tools/test_shell/test_web_worker.h
+++ b/webkit/tools/test_shell/test_web_worker.h
@@ -5,8 +5,6 @@
#ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_WEB_WORKER_H_
#define WEBKIT_TOOLS_TEST_SHELL_TEST_WEB_WORKER_H_
-#if ENABLE(WORKERS)
-
#include "base/basictypes.h"
#include "base/ref_counted.h"
#include "third_party/WebKit/WebKit/chromium/public/WebMessagePortChannel.h"
@@ -85,6 +83,4 @@ class TestWebWorker : public WebKit::WebWorker,
DISALLOW_COPY_AND_ASSIGN(TestWebWorker);
};
-#endif
-
#endif // WEBKIT_TOOLS_TEST_SHELL_TEST_WEB_WORKER_H_
diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc
index 258351c..1434e0d 100644
--- a/webkit/tools/test_shell/test_webview_delegate.cc
+++ b/webkit/tools/test_shell/test_webview_delegate.cc
@@ -6,10 +6,6 @@
// as the WebViewDelegate for the TestShellWebHost. The host is expected to
// have initialized a MessageLoop before these methods are called.
-#include "config.h"
-
-#undef LOG
-
#include "webkit/tools/test_shell/test_webview_delegate.h"
#include "app/gfx/native_widget_types.h"
@@ -591,11 +587,7 @@ WebPlugin* TestWebViewDelegate::createPlugin(
WebWorker* TestWebViewDelegate::createWorker(
WebFrame* frame, WebWorkerClient* client) {
-#if ENABLE(WORKERS)
return new TestWebWorker();
-#else
- return NULL;
-#endif
}
WebMediaPlayer* TestWebViewDelegate::createMediaPlayer(