WebKit Bugzilla
Attachment 346178 Details for
Bug 188174
: [WinCairo] Search terms are not saved for <input type="search">
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188174-20180731104807.patch (text/plain), 4.14 KB, created by
Stephan Szabo
on 2018-07-31 10:48:08 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Stephan Szabo
Created:
2018-07-31 10:48:08 PDT
Size:
4.14 KB
patch
obsolete
>Subversion Revision: 234370 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 3dafd0ac45297bd16a95c9c7b7c70fbc33d0187b..715b81cba7fc81aee19112652e0c80758966ae10 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,17 @@ >+2018-07-31 Stephan Szabo <stephan.szabo@sony.com> >+ >+ [WinCairo] Search terms are not saved for <input type="search"> >+ https://bugs.webkit.org/show_bug.cgi?id=188174 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/win/WebPageProxyWin.cpp: >+ (WebKit::autosaveKey): Get registry key name for search autosave >+ (WebKit::WebPageProxy::saveRecentSearches): Save searches to >+ registry >+ (WebKit::WebPageProxy::loadRecentSearches): Load searches from >+ registry >+ > 2018-07-30 Chris Dumez <cdumez@apple.com> > > Potential null dereference under WebPage::applicationDidBecomeActive() >diff --git a/Source/WebKit/UIProcess/win/WebPageProxyWin.cpp b/Source/WebKit/UIProcess/win/WebPageProxyWin.cpp >index c7483531f452e741ce6de4a60fa87b987c135fde..a22df7d853db6d8af7d47cc251355cc74af0d706 100644 >--- a/Source/WebKit/UIProcess/win/WebPageProxyWin.cpp >+++ b/Source/WebKit/UIProcess/win/WebPageProxyWin.cpp >@@ -27,9 +27,9 @@ > #include "config.h" > #include "WebPageProxy.h" > >-#include "NotImplemented.h" > #include "PageClientImpl.h" > #include <WebCore/UserAgent.h> >+#include <string> > > namespace WebKit { > >@@ -42,14 +42,68 @@ String WebPageProxy::standardUserAgent(const String& applicationNameForUserAgent > return WebCore::standardUserAgent(applicationNameForUserAgent); > } > >-void WebPageProxy::saveRecentSearches(const String&, const Vector<WebCore::RecentSearch>&) >+String autosaveKey(const String &name) > { >- notImplemented(); >+ return L"Software\\WebKit\\AutoSave\\save-" + name; > } > >-void WebPageProxy::loadRecentSearches(const String&, Vector<WebCore::RecentSearch>&) >+void WebPageProxy::saveRecentSearches(const String& name, const Vector<WebCore::RecentSearch>& searchItems) > { >- notImplemented(); >+ if (!name) >+ return; >+ >+ String keyName = autosaveKey(name); >+ HKEY key; >+ int keyResult = ::RegCreateKeyEx(HKEY_CURRENT_USER, keyName.characters16(), 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nullptr, &key, nullptr); >+ if (keyResult != ERROR_SUCCESS) >+ return; >+ >+ size_t size = searchItems.size(); >+ if (size) { >+ for (size_t i = 0; i < size; ++i) { >+ auto y = searchItems[i].string.characters16(); >+ if (::RegSetValueEx(key, std::to_wstring(i).c_str(), 0, REG_SZ, reinterpret_cast<const BYTE*>(searchItems[i].string.characters16()), searchItems[i].string.length() * sizeof(UChar)) != ERROR_SUCCESS) >+ return; >+ } >+ } >+ DWORD saveSize = size; >+ ::RegSetValueEx(key, L"count", 0, REG_DWORD, reinterpret_cast<BYTE *>(&saveSize), sizeof(DWORD)); >+} >+ >+void WebPageProxy::loadRecentSearches(const String& name, Vector<WebCore::RecentSearch>& searchItems) >+{ >+ if (!name) >+ return; >+ >+ String keyName = autosaveKey(name); >+ HKEY key; >+ if (::RegCreateKeyEx(HKEY_CURRENT_USER, keyName.characters16(), 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, nullptr, &key, nullptr) != ERROR_SUCCESS) >+ return; >+ >+ searchItems.clear(); >+ DWORD count; >+ DWORD type; >+ DWORD size = sizeof(count); >+ if (::RegQueryValueEx(key, L"count", nullptr, &type, reinterpret_cast<BYTE*>(&count), &size) != ERROR_SUCCESS) >+ return; >+ >+ if (type != REG_DWORD || size != sizeof(DWORD)) >+ return; >+ >+ for (DWORD i = 0; i < count; ++i) { >+ auto valueName = std::to_wstring(i); >+ if (::RegQueryValueEx(key, valueName.c_str(), nullptr, &type, nullptr, &size) != ERROR_SUCCESS) >+ continue; >+ >+ if (type != REG_SZ) >+ continue; >+ >+ auto buff = std::make_unique<BYTE[]>(size); >+ if (::RegQueryValueEx(key, valueName.c_str(), nullptr, &type, buff.get(), &size) != ERROR_SUCCESS) >+ continue; >+ >+ searchItems.append({ String { reinterpret_cast<UChar*>(buff.get()), size / 2 }, -WallTime::infinity() }); >+ } > } > > void WebPageProxy::editorStateChanged(const EditorState& editorState)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188174
:
346093
|
346178
|
346220
|
346656
|
352094
|
352625
|
352626
|
352627
|
352647
|
352735
|
352810