Skip to content

Commit 7ec833a

Browse files
author
Victor Wang
committed
2010-07-15 Victor Wang <victorw@chromium.org>
Reviewed by David Levin. [Chromium] Disable c4291 for chromium windows multi dll build. https://bugs.webkit.org/show_bug.cgi?id=42177 * JavaScriptCore.gyp/JavaScriptCore.gyp: 2010-07-15 Victor Wang <victorw@chromium.org> Reviewed by David Levin. [Chromium] Chromium webkit dll updates: -. Fix WEBKIT_IMPLEMENTATION in WebCommon so dllimport works as expected. -. Update webkit.gyp so targets that depend on webkit has correct macros defined. https://bugs.webkit.org/show_bug.cgi?id=42177 * WebKit.gyp: * public/WebCommon.h: 2010-07-15 Victor Wang <victorw@chromium.org> Reviewed by David Levin. [chromium] update KURLGoogle decodeURLEscapeSequences to use googleurl public api so it does not access functions in url_canon_internal. This is for chromium multi-dll build. https://bugs.webkit.org/show_bug.cgi?id=42177 Test: (unittest) WebKit\chromium\tests\KURLTest.cpp * platform/KURLGoogle.cpp: (WebCore::decodeURLEscapeSequences): Canonical link: https://commits.webkit.org/54356@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@63516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent c8c1956 commit 7ec833a

7 files changed

Lines changed: 69 additions & 51 deletions

File tree

JavaScriptCore/ChangeLog

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
2010-07-15 Victor Wang <victorw@chromium.org>
2+
3+
Reviewed by David Levin.
4+
5+
[Chromium] Disable c4291 for chromium windows multi dll build.
6+
7+
https://bugs.webkit.org/show_bug.cgi?id=42177
8+
9+
* JavaScriptCore.gyp/JavaScriptCore.gyp:
10+
111
2010-07-15 Geoffrey Garen <ggaren@apple.com>
212

313
Reviewed by Maciej Stachowiak.

JavaScriptCore/JavaScriptCore.gyp/JavaScriptCore.gyp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,18 @@
142142
'include_dirs!': [
143143
'<(SHARED_INTERMEDIATE_DIR)/webkit',
144144
],
145+
'conditions': [
146+
['inside_chromium_build==1 and component=="shared_library"', {
147+
# Chromium windows multi-dll build enables c++ exception and this
148+
# causes wtf generates 4291 warning due to operator new/delete
149+
# implementations. Disable the warning for chromium windows
150+
# multi-dll build.
151+
'msvs_disabled_warnings': [4291],
152+
'direct_dependent_settings': {
153+
'msvs_disabled_warnings': [4291],
154+
},
155+
}],
156+
],
145157
}],
146158
],
147159
},

WebCore/ChangeLog

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
2010-07-15 Victor Wang <victorw@chromium.org>
2+
3+
Reviewed by David Levin.
4+
5+
[chromium] update KURLGoogle decodeURLEscapeSequences to
6+
use googleurl public api so it does not access functions in
7+
url_canon_internal. This is for chromium multi-dll build.
8+
9+
https://bugs.webkit.org/show_bug.cgi?id=42177
10+
11+
Test: (unittest) WebKit\chromium\tests\KURLTest.cpp
12+
13+
* platform/KURLGoogle.cpp:
14+
(WebCore::decodeURLEscapeSequences):
15+
116
2010-07-15 Kent Tamura <tkent@chromium.org>
217

318
Reviewed by Eric Seidel.

WebCore/platform/KURLGoogle.cpp

Lines changed: 5 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#include <wtf/StdLibExtras.h>
4949
#include <wtf/text/CString.h>
5050

51-
#include <googleurl/src/url_canon_internal.h>
5251
#include <googleurl/src/url_util.h>
5352

5453
using WTF::isASCIILower;
@@ -943,55 +942,13 @@ String decodeURLEscapeSequences(const String& str, const TextEncoding& encoding)
943942

944943
const char* input = cstr.data();
945944
int inputLength = cstr.length();
946-
url_canon::RawCanonOutputT<char> unescaped;
947-
for (int i = 0; i < inputLength; i++) {
948-
if (input[i] == '%') {
949-
unsigned char ch;
950-
if (url_canon::DecodeEscaped(input, &i, inputLength, &ch))
951-
unescaped.push_back(ch);
952-
else {
953-
// Invalid escape sequence, copy the percent literal.
954-
unescaped.push_back('%');
955-
}
956-
} else {
957-
// Regular non-escaped 8-bit character.
958-
unescaped.push_back(input[i]);
959-
}
960-
}
961945

962-
// Convert that 8-bit to UTF-16. It's not clear IE does this at all to
963-
// JavaScript URLs, but Firefox and Safari do.
964-
url_canon::RawCanonOutputT<url_parse::UTF16Char> utf16;
965-
for (int i = 0; i < unescaped.length(); i++) {
966-
unsigned char uch = static_cast<unsigned char>(unescaped.at(i));
967-
if (uch < 0x80) {
968-
// Non-UTF-8, just append directly
969-
utf16.push_back(uch);
970-
} else {
971-
// next_ch will point to the last character of the decoded
972-
// character.
973-
int nextCharacter = i;
974-
unsigned codePoint;
975-
if (url_canon::ReadUTFChar(unescaped.data(), &nextCharacter,
976-
unescaped.length(), &codePoint)) {
977-
// Valid UTF-8 character, convert to UTF-16.
978-
url_canon::AppendUTF16Value(codePoint, &utf16);
979-
i = nextCharacter;
980-
} else {
981-
// KURL.cpp strips any sequences that are not valid UTF-8. This
982-
// sounds scary. Instead, we just keep those invalid code
983-
// points and promote to UTF-16. We copy all characters from
984-
// the current position to the end of the identified sqeuqnce.
985-
while (i < nextCharacter) {
986-
utf16.push_back(static_cast<unsigned char>(unescaped.at(i)));
987-
i++;
988-
}
989-
utf16.push_back(static_cast<unsigned char>(unescaped.at(i)));
990-
}
991-
}
992-
}
946+
url_canon::RawCanonOutputT<url_parse::UTF16Char> unescaped;
947+
948+
url_util::DecodeURLEscapeSequences(input, inputLength, &unescaped);
993949

994-
return String(reinterpret_cast<UChar*>(utf16.data()), utf16.length());
950+
return String(reinterpret_cast<UChar*>(unescaped.data()),
951+
unescaped.length());
995952
}
996953

997954
bool KURL::protocolIs(const char* protocol) const

WebKit/chromium/ChangeLog

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
2010-07-15 Victor Wang <victorw@chromium.org>
2+
3+
Reviewed by David Levin.
4+
5+
[Chromium] Chromium webkit dll updates:
6+
-. Fix WEBKIT_IMPLEMENTATION in WebCommon so
7+
dllimport works as expected.
8+
-. Update webkit.gyp so targets that depend on webkit
9+
has correct macros defined.
10+
11+
https://bugs.webkit.org/show_bug.cgi?id=42177
12+
13+
* WebKit.gyp:
14+
* public/WebCommon.h:
15+
116
2010-07-13 Zhenyao Mo <zmo@google.com>
217

318
Reviewed by Nate Chapin.

WebKit/chromium/WebKit.gyp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
'src',
100100
],
101101
'defines': [
102-
'WEBKIT_IMPLEMENTATION',
102+
'WEBKIT_IMPLEMENTATION=1',
103103
],
104104
'sources': [
105105
'public/gtk/WebInputEventFactory.h',
@@ -488,10 +488,10 @@
488488
['component=="shared_library"', {
489489
'defines': [
490490
'WEBKIT_DLL',
491-
'USING_V8_SHARED',
492491
],
493492
'dependencies': [
494493
'../../WebCore/WebCore.gyp/WebCore.gyp:webcore_bindings',
494+
'<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
495495
'<(chromium_src_dir)/gpu/gpu.gyp:gles2_c_lib',
496496
'<(chromium_src_dir)/third_party/icu/icu.gyp:*',
497497
'<(chromium_src_dir)/third_party/libjpeg/libjpeg.gyp:libjpeg',
@@ -504,6 +504,15 @@
504504
'<(chromium_src_dir)/third_party/zlib/zlib.gyp:zlib',
505505
'<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
506506
],
507+
'direct_dependent_settings': {
508+
'defines': [
509+
'WEBKIT_DLL',
510+
],
511+
},
512+
'export_dependent_settings': [
513+
'<(chromium_src_dir)/build/temp_gyp/googleurl.gyp:googleurl',
514+
'<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
515+
],
507516
}],
508517
],
509518
}, {

WebKit/chromium/public/WebCommon.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
// Exported symbols need to be annotated with WEBKIT_API
6767

6868
#if defined(WIN32) && defined(WEBKIT_DLL)
69-
#if defined(WEBKIT_IMPLEMENTATION)
69+
#if WEBKIT_IMPLEMENTATION
7070
#define WEBKIT_API __declspec(dllexport)
7171
#else
7272
#define WEBKIT_API __declspec(dllimport)

0 commit comments

Comments
 (0)