diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-06 20:21:59 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-06 20:21:59 +0000 |
commit | 7ea066a9c3e54b7a2fd0c2ac30c8f4a64cf8eb90 (patch) | |
tree | 2f283b622f4ee681e05e7e6119903146f6f4d1ea /chrome/browser | |
parent | d2515f6e52f42d4baaa3c676ba1370ffa1f263eb (diff) | |
download | chromium_src-7ea066a9c3e54b7a2fd0c2ac30c8f4a64cf8eb90.zip chromium_src-7ea066a9c3e54b7a2fd0c2ac30c8f4a64cf8eb90.tar.gz chromium_src-7ea066a9c3e54b7a2fd0c2ac30c8f4a64cf8eb90.tar.bz2 |
Stop serializing WebString over IPC. The new rule is that only POD (plain old
data) types from WebKit API are allowed to be used in the browser process.
I added a big note about this to webkit_param_traits.h to explain the details
of this decision.
R=dglazkov
Review URL: http://codereview.chromium.org/62032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13181 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.cc | 28 | ||||
-rw-r--r-- | chrome/browser/renderer_host/render_view_host.h | 10 | ||||
-rw-r--r-- | chrome/browser/ssl/ssl_manager.cc | 6 | ||||
-rw-r--r-- | chrome/browser/ssl/ssl_manager.h | 8 | ||||
-rw-r--r-- | chrome/browser/ssl/ssl_policy.cc | 7 |
5 files changed, 26 insertions, 33 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index 749f93c..0f80652 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -35,13 +35,12 @@ #include "chrome/common/thumbnail_score.h" #include "net/base/net_util.h" #include "skia/include/SkBitmap.h" -#include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h" -#include "third_party/WebKit/WebKit/chromium/public/WebFindInPageRequest.h" +#include "third_party/WebKit/WebKit/chromium/public/WebFindOptions.h" #include "webkit/glue/autofill_form.h" using base::TimeDelta; using WebKit::WebConsoleMessage; -using WebKit::WebFindInPageRequest; +using WebKit::WebFindOptions; using WebKit::WebInputEvent; namespace { @@ -349,20 +348,18 @@ bool RenderViewHost::PrintPages() { } void RenderViewHost::StartFinding(int request_id, - const string16& search_string, + const string16& search_text, bool forward, bool match_case, bool find_next) { - if (search_string.empty()) + if (search_text.empty()) return; - WebFindInPageRequest request; - request.identifier = request_id; - request.text = search_string; - request.forward = forward; - request.matchCase = match_case; - request.findNext = find_next; - Send(new ViewMsg_Find(routing_id(), request)); + WebFindOptions options; + options.forward = forward; + options.matchCase = match_case; + options.findNext = find_next; + Send(new ViewMsg_Find(routing_id(), request_id, search_text, options)); // This call is asynchronous and returns immediately. // The result of the search is sent as a notification message by the renderer. @@ -437,8 +434,11 @@ void RenderViewHost::InsertCSSInWebFrame( } void RenderViewHost::AddMessageToConsole( - const std::wstring& frame_xpath, const WebConsoleMessage& message) { - Send(new ViewMsg_AddMessageToConsole(routing_id(), frame_xpath, message)); + const string16& frame_xpath, + const string16& message, + const WebConsoleMessage::Level& level) { + Send(new ViewMsg_AddMessageToConsole( + routing_id(), frame_xpath, message, level)); } void RenderViewHost::DebugCommand(const std::wstring& cmd) { diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index 1923aff..8813a2c 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -17,6 +17,7 @@ #ifdef CHROME_PERSONALIZATION #include "chrome/personalization/personalization.h" #endif +#include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h" #include "webkit/glue/autofill_form.h" #include "webkit/glue/password_form_dom_manager.h" #include "webkit/glue/window_open_disposition.h" @@ -49,10 +50,6 @@ namespace webkit_glue { struct WebApplicationInfo; } -namespace WebKit { -struct WebConsoleMessage; -} - // // RenderViewHost // @@ -238,8 +235,9 @@ class RenderViewHost : public RenderWidgetHost { const std::string& css); // Logs a message to the console of a frame in the page. - void AddMessageToConsole(const std::wstring& frame_xpath, - const WebKit::WebConsoleMessage&); + void AddMessageToConsole(const string16& frame_xpath, + const string16& message, + const WebKit::WebConsoleMessage::Level&); // Send command to the debugger void DebugCommand(const std::wstring& cmd); diff --git a/chrome/browser/ssl/ssl_manager.cc b/chrome/browser/ssl/ssl_manager.cc index 42c6ec0..2d953eb 100644 --- a/chrome/browser/ssl/ssl_manager.cc +++ b/chrome/browser/ssl/ssl_manager.cc @@ -28,7 +28,6 @@ #include "net/base/cert_status_flags.h" #include "net/base/net_errors.h" #include "net/url_request/url_request.h" -#include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h" #include "webkit/glue/resource_type.h" #if defined(OS_WIN) @@ -179,14 +178,15 @@ bool SSLManager::SetMaxSecurityStyle(SecurityStyle style) { } // Delegate API method. -void SSLManager::AddMessageToConsole(const WebConsoleMessage& message) { +void SSLManager::AddMessageToConsole(const string16& message, + const WebConsoleMessage::Level& level) { TabContents* tab_contents = controller_->tab_contents(); WebContents* web_contents = tab_contents->AsWebContents(); if (!web_contents) return; web_contents->render_view_host()->AddMessageToConsole( - std::wstring(), message); + string16(), message, level); } // Delegate API method. diff --git a/chrome/browser/ssl/ssl_manager.h b/chrome/browser/ssl/ssl_manager.h index 14baf7a..d477e36 100644 --- a/chrome/browser/ssl/ssl_manager.h +++ b/chrome/browser/ssl/ssl_manager.h @@ -21,6 +21,7 @@ #include "net/base/net_errors.h" #include "net/base/ssl_info.h" #include "net/base/x509_certificate.h" +#include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h" #include "webkit/glue/resource_type.h" class AutomationProvider; @@ -37,10 +38,6 @@ class Task; class URLRequest; class WebContents; -namespace WebKit { -struct WebConsoleMessage; -} - // The SSLManager SSLManager controls the SSL UI elements in a TabContents. It // listens for various events that influence when these elements should or // should not be displayed and adjusts them accordingly. @@ -376,7 +373,8 @@ class SSLManager : public NotificationObserver { bool SetMaxSecurityStyle(SecurityStyle style); // Logs a message to the console of the page. - void AddMessageToConsole(const WebKit::WebConsoleMessage&); + void AddMessageToConsole(const string16& message, + const WebKit::WebConsoleMessage::Level&); // Records that |cert| is permitted to be used for |host| in the future. void DenyCertForHost(net::X509Certificate* cert, const std::string& host); diff --git a/chrome/browser/ssl/ssl_policy.cc b/chrome/browser/ssl/ssl_policy.cc index 0b2bcfe..5edef80a 100644 --- a/chrome/browser/ssl/ssl_policy.cc +++ b/chrome/browser/ssl/ssl_policy.cc @@ -25,7 +25,6 @@ #include "grit/generated_resources.h" #include "net/base/cert_status_flags.h" #include "net/base/ssl_info.h" -#include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h" #include "webkit/glue/resource_type.h" #if defined(OS_WIN) @@ -165,10 +164,8 @@ static void AddMixedContentWarningToConsole( IDS_MIXED_CONTENT_LOG_MESSAGE, UTF8ToWide(handler->frame_origin()), UTF8ToWide(handler->request_url().spec())); - WebConsoleMessage message; - message.text = WideToUTF16Hack(text); - message.level = WebConsoleMessage::LevelWarning; - handler->manager()->AddMessageToConsole(message); + handler->manager()->AddMessageToConsole( + WideToUTF16Hack(text), WebConsoleMessage::LevelWarning); } } // namespace |